MCPcopy Create free account
hub / github.com/EasyIME/PIME / _atexit_callback

Function _atexit_callback

python/python3/tornado/platform/asyncio.py:58–72  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

56
57
58def _atexit_callback() -> None:
59 for loop in _selector_loops:
60 with loop._select_cond:
61 loop._closing_selector = True
62 loop._select_cond.notify()
63 try:
64 loop._waker_w.send(b"a")
65 except BlockingIOError:
66 pass
67 # If we don't join our (daemon) thread here, we may get a deadlock
68 # during interpreter shutdown. I don't really understand why. This
69 # deadlock happens every time in CI (both travis and appveyor) but
70 # I've never been able to reproduce locally.
71 loop._thread.join()
72 _selector_loops.clear()
73
74
75atexit.register(_atexit_callback)

Callers

nothing calls this directly

Calls 3

notifyMethod · 0.80
joinMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected