From d2daff42e8170f884c1d20c446928d25b68f136f Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 7 Mar 2014 16:24:55 +0100 Subject: Condition.notify only does nothing if no thread is waiting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/join.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/join.py b/src/join.py index efff6e1..7d4be9f 100644 --- a/src/join.py +++ b/src/join.py @@ -123,7 +123,8 @@ def join(*fs): rc = [] for f in fs: f.condition.acquire() - f.condition.wait() + if not len(f.queue): + f.condition.wait() rc.append(f.queue.pop(0)) f.condition.release() return rc[0] if len(fs) == 1 else rc -- cgit v1.2.3-70-g09d2