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.
()
| 1451 | # Global API functions |
| 1452 | |
| 1453 | def current_thread(): |
| 1454 | """Return the current Thread object, corresponding to the caller's thread of control. |
| 1455 | |
| 1456 | If the caller's thread of control was not created through the threading |
| 1457 | module, a dummy thread object with limited functionality is returned. |
| 1458 | |
| 1459 | """ |
| 1460 | try: |
| 1461 | return _active[get_ident()] |
| 1462 | except KeyError: |
| 1463 | return _DummyThread() |
| 1464 | |
| 1465 | def currentThread(): |
| 1466 | """Return the current Thread object, corresponding to the caller's thread of control. |
no test coverage detected