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.
()
| 1468 | # Global API functions |
| 1469 | |
| 1470 | def 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 | |
| 1482 | def currentThread(): |
| 1483 | """Return the current Thread object, corresponding to the caller's thread of control. |
no test coverage detected