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

Function start_joinable_thread

Lib/_dummy_thread.py:85–101  ·  view source on GitHub ↗

Dummy implementation of _thread.start_joinable_thread(). In dummy thread, we just run the function synchronously.

(function, handle=None, daemon=True)

Source from the content-addressed store, hash-verified

83
84
85def start_joinable_thread(function, handle=None, daemon=True):
86 """Dummy implementation of _thread.start_joinable_thread().
87
88 In dummy thread, we just run the function synchronously.
89 """
90 if handle is None:
91 handle = _ThreadHandle()
92 try:
93 function()
94 except SystemExit:
95 pass
96 except:
97 import traceback
98
99 traceback.print_exc()
100 handle._set_done()
101 return handle
102
103
104def daemon_threads_allowed():

Callers

nothing calls this directly

Calls 4

print_excMethod · 0.80
_ThreadHandleClass · 0.70
functionFunction · 0.50
_set_doneMethod · 0.45

Tested by

no test coverage detected