diff options
Diffstat (limited to 'tests/thread/thread_exc1.py')
-rw-r--r-- | tests/thread/thread_exc1.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/thread/thread_exc1.py b/tests/thread/thread_exc1.py index 10fb94b4f..16483d777 100644 --- a/tests/thread/thread_exc1.py +++ b/tests/thread/thread_exc1.py @@ -4,9 +4,11 @@ import _thread + def foo(): raise ValueError + def thread_entry(): try: foo() @@ -16,6 +18,7 @@ def thread_entry(): global n_finished n_finished += 1 + lock = _thread.allocate_lock() n_thread = 4 n_finished = 0 @@ -27,4 +30,4 @@ for i in range(n_thread): # busy wait for threads to finish while n_finished < n_thread: pass -print('done') +print("done") |