Skip to content

Commit

Permalink
Join threads at end of multi-threading example (#1934)
Browse files Browse the repository at this point in the history
  • Loading branch information
jleibs authored and teh-cmc committed Apr 20, 2023
1 parent 687a982 commit ccf376f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions examples/python/multithreading/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,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)

Expand Down

0 comments on commit ccf376f

Please sign in to comment.