From ce016087be56806607b453dc30cc2203bfcee353 Mon Sep 17 00:00:00 2001 From: Jeremy Leibs Date: Wed, 19 Apr 2023 18:29:51 +0200 Subject: [PATCH] Join threads at end of multi-threading example --- examples/python/multithreading/main.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/examples/python/multithreading/main.py b/examples/python/multithreading/main.py index eeb6f2ed9f49..aa1a2f53883e 100755 --- a/examples/python/multithreading/main.py +++ b/examples/python/multithreading/main.py @@ -26,11 +26,16 @@ def main() -> None: rr.script_setup(args, "multithreading") + threads = [] for i in range(10): t = threading.Thread( target=rect_logger, args=("thread/{}".format(i), [random.randrange(255) for _ in range(3)]) ) t.start() + threads.append(t) + + for t in threads: + t.join() rr.script_teardown(args)