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

Function current_thread

Lib/threading.py:1470–1480  ·  view source on GitHub ↗

Return the current Thread object, corresponding to the caller's thread of control. If the caller's thread of control was not created through the threading module, a dummy thread object with limited functionality is returned.

()

Source from the content-addressed store, hash-verified

1468# Global API functions
1469
1470def current_thread():
1471 """Return the current Thread object, corresponding to the caller's thread of control.
1472
1473 If the caller's thread of control was not created through the threading
1474 module, a dummy thread object with limited functionality is returned.
1475
1476 """
1477 try:
1478 return _active[get_ident()]
1479 except KeyError:
1480 return _DummyThread()
1481
1482def currentThread():
1483 """Return the current Thread object, corresponding to the caller's thread of control.

Callers 5

get_dictMethod · 0.90
create_dictMethod · 0.90
__init__Method · 0.85
joinMethod · 0.85
currentThreadFunction · 0.85

Calls 2

_DummyThreadClass · 0.85
get_identFunction · 0.70

Tested by

no test coverage detected