From 84c0ca41b9425bcf295ca7bf1601179b9d6aa9ca Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 7 Mar 2014 04:05:58 +0100 Subject: add concurrently (extra) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/test.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/test.py') 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): -- cgit v1.2.3-70-g09d2