aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2014-03-07 04:05:58 +0100
committerMattias Andrée <maandree@operamail.com>2014-03-07 04:05:58 +0100
commit84c0ca41b9425bcf295ca7bf1601179b9d6aa9ca (patch)
treedaf442338f74ee43e01096f742755efcf2ffb4fe
parentdo not use conditions when not needed (diff)
downloadjoin-python-84c0ca41b9425bcf295ca7bf1601179b9d6aa9ca.tar.gz
join-python-84c0ca41b9425bcf295ca7bf1601179b9d6aa9ca.tar.bz2
join-python-84c0ca41b9425bcf295ca7bf1601179b9d6aa9ca.tar.xz
add concurrently (extra)
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rwxr-xr-xsrc/test.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test.py b/src/test.py
index ae76886..987fe0c 100755
--- a/src/test.py
+++ b/src/test.py
@@ -94,6 +94,15 @@ def unordered_join(*f_groups):
return rc
+# extra, not a part of join-calculus
+def concurrently(*fs):
+ ts = [threading.Thread(target = f, args = args, kwargs = kwargs) for f in fs]
+ for t in ts:
+ ts.start()
+ for t in ts:
+ ts.join()
+
+
class test:
@signal
def signal(f, *args):