MCPcopy Create free account
hub / github.com/tensorpack/tensorpack / is_main_thread

Function is_main_thread

tensorpack/utils/concurrency.py:194–199  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

192
193
194def is_main_thread():
195 if six.PY2:
196 return isinstance(threading.current_thread(), threading._MainThread)
197 else:
198 # a nicer solution with py3
199 return threading.current_thread() == threading.main_thread()
200
201
202@contextmanager

Callers 1

mask_sigintFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…