diff options
Diffstat (limited to 'tests/thread/thread_lock4.py')
-rw-r--r-- | tests/thread/thread_lock4.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/thread/thread_lock4.py b/tests/thread/thread_lock4.py index 2f9d42d6b..bbf904399 100644 --- a/tests/thread/thread_lock4.py +++ b/tests/thread/thread_lock4.py @@ -8,12 +8,14 @@ except ImportError: import time import _thread + def fac(n): x = 1 for i in range(1, n + 1): x *= i return x + def thread_entry(): while True: with jobs_lock: @@ -25,6 +27,7 @@ def thread_entry(): with output_lock: output.append((arg, ans)) + # create a list of jobs jobs = [(fac, i) for i in range(20, 80)] jobs_lock = _thread.allocate_lock() |