mirror of
https://github.com/python/cpython.git
synced 2025-11-01 10:45:30 +00:00
Issue #23799: Added test.support.start_threads() for running and cleaning up
multiple threads.
This commit is contained in:
parent
8218bd4caf
commit
263dcd20a3
9 changed files with 77 additions and 80 deletions
|
|
@ -202,15 +202,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