]> err.no Git - dak/commitdiff
fix threadpool's joinAll() method
authorTorsten Werner <twerner@debian.org>
Thu, 30 Dec 2010 18:22:22 +0000 (19:22 +0100)
committerTorsten Werner <twerner@debian.org>
Fri, 31 Dec 2010 10:50:05 +0000 (11:50 +0100)
Signed-off-by: Torsten Werner <twerner@debian.org>
daklib/threadpool.py

index 5b17e3c496c5e99959badedc2c97402a5572eb5d..f075f5c380c8907959103b2d33ebe9d174270f30 100644 (file)
@@ -131,14 +131,15 @@ class ThreadPool:
         # Tell all the threads to quit
         self.__resizeLock.acquire()
         try:
-            self.__setThreadCountNolock(0)
-            self.__isJoining = True
-
             # Wait until all threads have exited
             if waitForThreads:
+                for t in self.__threads:
+                    t.goAway()
                 for t in self.__threads:
                     t.join()
                     del t
+            self.__setThreadCountNolock(0)
+            self.__isJoining = True
 
             # Reset the pool for potential reuse
             self.__isJoining = False