mirror of
https://github.com/python/cpython.git
synced 2025-07-24 11:44:31 +00:00
Issue #23799: Added test.support.start_threads() for running and cleaning up
multiple threads.
This commit is contained in:
commit
c05e260ecb
9 changed files with 75 additions and 78 deletions
|
@ -284,15 +284,11 @@ class TestPendingCalls(unittest.TestCase):
|
|||
context.lock = threading.Lock()
|
||||
context.event = threading.Event()
|
||||
|
||||
for i in range(context.nThreads):
|
||||
t = threading.Thread(target=self.pendingcalls_thread, args = (context,))
|
||||
t.start()
|
||||
threads.append(t)
|
||||
|
||||
self.pendingcalls_wait(context.l, n, context)
|
||||
|
||||
for t in threads:
|
||||
t.join()
|
||||
threads = [threading.Thread(target=self.pendingcalls_thread,
|
||||
args=(context,))
|
||||
for i in range(context.nThreads)]
|
||||
with support.start_threads(threads):
|
||||
self.pendingcalls_wait(context.l, n, context)
|
||||
|
||||
def pendingcalls_thread(self, context):
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue