diff options
Diffstat (limited to 'tests/thread/thread_shared1.py')
-rw-r--r-- | tests/thread/thread_shared1.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/thread/thread_shared1.py b/tests/thread/thread_shared1.py index 13c6651cc..582b01fc3 100644 --- a/tests/thread/thread_shared1.py +++ b/tests/thread/thread_shared1.py @@ -4,9 +4,11 @@ import _thread + def foo(i): pass + def thread_entry(n, tup): for i in tup: foo(i) @@ -14,6 +16,7 @@ def thread_entry(n, tup): global n_finished n_finished += 1 + lock = _thread.allocate_lock() n_thread = 2 n_finished = 0 |