MCPcopy Create free account
hub / github.com/fabioz/PyDev.Debugger / get_thread_id

Function get_thread_id

_pydevd_bundle/pydevd_constants.py:669–681  ·  view source on GitHub ↗
(thread)

Source from the content-addressed store, hash-verified

667
668
669def get_thread_id(thread):
670 try:
671 # Fast path without getting lock.
672 tid = thread.__pydevd_id__
673 if tid is None:
674 # Fix for https://www.brainwy.com/tracker/PyDev/645
675 # if __pydevd_id__ is None, recalculate it... also, use an heuristic
676 # that gives us always the same id for the thread (using thread.ident or id(thread)).
677 raise AttributeError()
678 except AttributeError:
679 tid = _get_or_compute_thread_id_with_lock(thread, is_current_thread=False)
680
681 return tid
682
683
684def set_thread_id(thread, thread_id):

Tested by

no test coverage detected