diff options
| author | Mattias Andrée <maandree@operamail.com> | 2014-03-07 16:24:55 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2014-03-07 16:24:55 +0100 |
| commit | d2daff42e8170f884c1d20c446928d25b68f136f (patch) | |
| tree | 2e1840acaff3f666bb029d25b38b33b4417791d0 | |
| parent | remove x flags from join.py (diff) | |
| download | join-python-d2daff42e8170f884c1d20c446928d25b68f136f.tar.gz join-python-d2daff42e8170f884c1d20c446928d25b68f136f.tar.bz2 join-python-d2daff42e8170f884c1d20c446928d25b68f136f.tar.xz | |
Condition.notify only does nothing if no thread is waiting
Signed-off-by: Mattias Andrée <maandree@operamail.com>
| -rw-r--r-- | src/join.py | 3 |
1 files changed, 2 insertions, 1 deletions
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 |
