We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 76ab101 commit db233a3Copy full SHA for db233a3
1 file changed
Lib/test/test_free_threading/test_type.py
@@ -1,13 +1,12 @@
1
import unittest
2
3
+from concurrent.futures import ThreadPoolExecutor
4
from threading import Thread
5
from unittest import TestCase
6
7
from test.support import threading_helper, import_helper
8
9
-multiprocessing_dummy = import_helper.import_module('multiprocessing.dummy')
10
-Pool = multiprocessing_dummy.Pool
11
12
NTHREADS = 6
13
BOTTOM = 0
@@ -36,11 +35,10 @@ def write(id0):
36
35
A.attr = x
37
38
39
- with Pool(NTHREADS) as pool:
40
- pool.apply_async(read, (1,))
41
- pool.apply_async(write, (1,))
42
- pool.close()
43
- pool.join()
+ with ThreadPoolExecutor(NTHREADS) as pool:
+ pool.submit(read, (1,))
+ pool.submit(write, (1,))
+ pool.shutdown(wait=True)
44
45
def test_attr_cache_consistency(self):
46
class C:
0 commit comments