aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-07 03:29:50 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-07 03:29:50 +0100
commit759c398edbe89c187d41fa1183f2efc44078f391 (patch)
tree817db537a316d084b837e9deebf53b79ea6973a0 /src
parentadd test (diff)
downloadjoin-python-759c398edbe89c187d41fa1183f2efc44078f391.tar.gz
join-python-759c398edbe89c187d41fa1183f2efc44078f391.tar.bz2
join-python-759c398edbe89c187d41fa1183f2efc44078f391.tar.xz
join can join many functions
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to 'src')
-rwxr-xr-xsrc/test.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/test.py b/src/test.py
index 125d979..2190451 100755
--- a/src/test.py
+++ b/src/test.py
@@ -44,12 +44,14 @@ class joinable:
self.condition.release()
-def join(f):
- f.condition.acquire()
- f.condition.wait()
- (jargs, jkwargs) = f.queue.pop(0)
- f.condition.release()
- return (jargs, jkwargs)
+def join(*fs):
+ rc = []
+ for f in fs:
+ f.condition.acquire()
+ f.condition.wait()
+ rc.append(f.queue.pop(0))
+ f.condition.release()
+ return rc[0] if len(fs) == 1 else rc
class test: