+import _thread
import contextlib
import functools
-import _thread
+import sys
import threading
import time
values = None
time.sleep(0.01)
- gc_collect()
+ support.gc_collect()
def reap_threads(func):
f"(count: {count}, old count: {old_count})")
raise AssertionError(msg)
time.sleep(0.010)
- gc_collect()
+ support.gc_collect()
def join_thread(thread, timeout=None):
t.start()
started.append(t)
except:
- if verbose:
+ if support.verbose:
print("Can't start %d threads, only %d threads started" %
(len(threads), len(started)))
raise
try:
if unlock:
unlock()
- endtime = starttime = time.monotonic()
+ endtime = time.monotonic()
for timeout in range(1, 16):
endtime += 60
for t in started:
started = [t for t in started if t.is_alive()]
if not started:
break
- if verbose:
+ if support.verbose:
print('Unable to join %d threads during a period of '
'%d minutes' % (len(started), timeout))
finally: