summaryrefslogtreecommitdiff
path: root/tests/thread/thread_shared2.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/thread/thread_shared2.py')
-rw-r--r--tests/thread/thread_shared2.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/thread/thread_shared2.py b/tests/thread/thread_shared2.py
index e4bfe7802..a1223c2b9 100644
--- a/tests/thread/thread_shared2.py
+++ b/tests/thread/thread_shared2.py
@@ -5,9 +5,11 @@
import _thread
+
def foo(lst, i):
lst[i] += 1
+
def thread_entry(n, lst, idx):
for i in range(n):
foo(lst, idx)
@@ -15,6 +17,7 @@ def thread_entry(n, lst, idx):
global n_finished
n_finished += 1
+
lock = _thread.allocate_lock()
n_thread = 2
n_finished = 0