MCPcopy
hub / github.com/tornadoweb/tornado / _atexit_callback

Function _atexit_callback

tornado/platform/asyncio.py:73–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

71
72
73def _atexit_callback() -> None:
74 for loop in _selector_loops:
75 with loop._select_cond:
76 loop._closing_selector = True
77 loop._select_cond.notify()
78 try:
79 loop._waker_w.send(b"a")
80 except BlockingIOError:
81 pass
82 if loop._thread is not None:
83 # If we don't join our (daemon) thread here, we may get a deadlock
84 # during interpreter shutdown. I don't really understand why. This
85 # deadlock happens every time in CI (both travis and appveyor) but
86 # I've never been able to reproduce locally.
87 loop._thread.join()
88 _selector_loops.clear()
89
90
91atexit.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