]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Apply debug
authorapo <apo@opencascade.com>
Mon, 12 Dec 2005 07:15:30 +0000 (07:15 +0000)
committerapo <apo@opencascade.com>
Mon, 12 Dec 2005 07:15:30 +0000 (07:15 +0000)
src/VVTK/VVTK_ImageWriter.cxx
src/VVTK/VVTK_ImageWriterMgr.cxx

index a4f4807332c64babb039f9bcbbfeb3b3694f6d81..9d04759878202e582e0d658e41de7e7b9b80376d 100755 (executable)
@@ -103,7 +103,10 @@ VVTK_ImageWriter
   aWriter->Delete();\r
   myImageData->Delete();\r
 \r
-  if(MYDEBUG) cout<<"VVTK_ImageWriter::run() - this = "<<this<<endl;\r
+  if(MYDEBUG) cout<<"VVTK_ImageWriter::run "<<\r
+               "- this = "<<this<<\r
+               "; total = "<<mySemaphore->total()<<\r
+               "; available = "<<mySemaphore->available()<<endl;\r
   *mySemaphore -= 1;\r
 }\r
 \r
index d327fcfd54006fc8af272f0dc68500045d0add30..68b6d163c3986dda094afde3389b5589a9086b68 100755 (executable)
@@ -46,9 +46,12 @@ static int MYDEBUG = 0;
 VVTK_ImageWriterMgr\r
 ::VVTK_ImageWriterMgr()\r
 {\r
-  int aMax = std::numeric_limits<int>::max();\r
+  int aMax = std::numeric_limits<int>::max() / 2;\r
   mySemaphore = new QSemaphore(aMax);\r
   *mySemaphore += aMax;\r
+  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::VVTK_ImageWriterMgr "<<\r
+               "- total = "<<mySemaphore->total()<<\r
+               "; available = "<<mySemaphore->available()<<endl;\r
 }\r
 \r
 \r
@@ -87,11 +90,18 @@ void
 VVTK_ImageWriterMgr\r
 ::Stop()\r
 {\r
-  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop - *mySemaphore -= "<<myThreads.size()<<endl;\r
+  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop "<<\r
+               "- total = "<<mySemaphore->total()<<\r
+               "; available = "<<mySemaphore->available()<<endl;\r
+  if(MYDEBUG) cout<<"VVTK_ImageWriterMgr::Stop - *mySemaphore += "<<myThreads.size()<<endl;\r
   *mySemaphore += myThreads.size();\r
 \r
-  for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++)\r
-    delete myThreads[anId];\r
+  for(size_t anId = 0, anEnd = myThreads.size(); anId < anEnd; anId++){\r
+    VVTK_ImageWriter* anImageWriter = myThreads[anId];\r
+    while(!anImageWriter->finished())\r
+      sleep(100);\r
+    delete anImageWriter;\r
+  }\r
 \r
   myThreads.clear();\r
 }\r