diff options
| author | Mattias Andrée <maandree@operamail.com> | 2014-03-07 04:05:58 +0100 |
|---|---|---|
| committer | Mattias Andrée <maandree@operamail.com> | 2014-03-07 04:05:58 +0100 |
| commit | 84c0ca41b9425bcf295ca7bf1601179b9d6aa9ca (patch) | |
| tree | daf442338f74ee43e01096f742755efcf2ffb4fe /src/test.py | |
| parent | do not use conditions when not needed (diff) | |
| download | join-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-x | src/test.py | 9 |
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): |
