[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[dak/master] fix threadpool's joinAll() method



Signed-off-by: Torsten Werner <twerner@debian.org>
---
 daklib/threadpool.py |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/daklib/threadpool.py b/daklib/threadpool.py
index 5b17e3c..f075f5c 100644
--- a/daklib/threadpool.py
+++ b/daklib/threadpool.py
@@ -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
-- 
1.5.6.5


Reply to: