From: Torsten Werner Date: Thu, 30 Dec 2010 18:22:22 +0000 (+0100) Subject: fix threadpool's joinAll() method X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=760aa550e25e3af39ec4945d4343209c11e55677;p=dak fix threadpool's joinAll() method Signed-off-by: Torsten Werner --- diff --git a/daklib/threadpool.py b/daklib/threadpool.py index 5b17e3c4..f075f5c3 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