MCPcopy Index your code
hub / github.com/RustPython/RustPython / __enter__

Method __enter__

Lib/test/lock_tests.py:59–74  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

57 break
58
59 def __enter__(self):
60 self._wait_thread = threading_helper.wait_threads_exit(support.SHORT_TIMEOUT)
61 self._wait_thread.__enter__()
62
63 try:
64 for _ in range(self.nthread):
65 start_new_thread(self.task, ())
66 except:
67 self._can_exit = True
68 raise
69
70 for _ in support.sleeping_retry(support.SHORT_TIMEOUT):
71 if len(self.started) >= self.nthread:
72 break
73
74 return self
75
76 def __exit__(self, exc_type, exc_value, traceback):
77 for _ in support.sleeping_retry(support.SHORT_TIMEOUT):

Callers

nothing calls this directly

Calls 2

start_new_threadFunction · 0.90
lenFunction · 0.85

Tested by

no test coverage detected