| 1426 | # when we exit (conform previous semantics). |
| 1427 | |
| 1428 | class _DummyThread(Thread): |
| 1429 | |
| 1430 | def __init__(self): |
| 1431 | Thread.__init__(self, name=_newname("Dummy-%d"), daemon=True) |
| 1432 | |
| 1433 | self._started.set() |
| 1434 | self._set_ident() |
| 1435 | if _HAVE_THREAD_NATIVE_ID: |
| 1436 | self._set_native_id() |
| 1437 | with _active_limbo_lock: |
| 1438 | _active[self._ident] = self |
| 1439 | |
| 1440 | def _stop(self): |
| 1441 | pass |
| 1442 | |
| 1443 | def is_alive(self): |
| 1444 | assert not self._is_stopped and self._started.is_set() |
| 1445 | return True |
| 1446 | |
| 1447 | def join(self, timeout=None): |
| 1448 | assert False, "cannot join a dummy thread" |
| 1449 | |
| 1450 | |
| 1451 | # Global API functions |