X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=daklib%2Fthreadpool.py;h=f075f5c380c8907959103b2d33ebe9d174270f30;hb=ec257c02a5d62fd27844c70814acd9616b24b4c8;hp=5b17e3c496c5e99959badedc2c97402a5572eb5d;hpb=0216544ee8c5aca451b9133f908adb686cd8f68d;p=dak.git 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