From ccb9672b3bc1c33249bfdc19e97f94a918119398 Mon Sep 17 00:00:00 2001 From: Gary van der Merwe Date: Tue, 8 Jan 2008 19:04:40 +0200 Subject: [PATCH] Fix bug when stoping the thread pool, introduced by the prev rev. --- picard/util/thread.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/picard/util/thread.py b/picard/util/thread.py index d8eed0118..1a370c306 100644 --- a/picard/util/thread.py +++ b/picard/util/thread.py @@ -91,8 +91,12 @@ class ThreadPool(QtCore.QObject): def stop(self): for thread in self.threads: thread.stop() - for queue in self.queues: - queue.unlock() + + # FIXME: if a queue is in more than 1 thread, unlock will be called + # more than once. + for thread in self.threads: + for queue in thread.queues: + queue.unlock() #for thread in self.threads: # self.log.debug("Waiting for %r", thread) # thread.wait()