Skip to content

Commit 9d01cc7

Browse files
review: use run_concurrently
1 parent ec593df commit 9d01cc7

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

Lib/test/test_free_threading/test_collections.py

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import threading
21
import unittest
32
from collections import Counter, deque
43
from copy import copy
@@ -57,12 +56,9 @@ def test_update_concurrent(self):
5756
PER_THREAD = 5000
5857
c = Counter()
5958
data = ('x',) * PER_THREAD
60-
threads = [threading.Thread(target=c.update, args=(data,))
61-
for _ in range(NTHREADS)]
62-
for t in threads:
63-
t.start()
64-
for t in threads:
65-
t.join()
59+
threading_helper.run_concurrently(
60+
c.update, nthreads=NTHREADS, args=(data,)
61+
)
6662

6763

6864
if __name__ == "__main__":

0 commit comments

Comments
 (0)