def METHOD_NAME() -> None:
    global _event_loop, _event_loop_refcnt
    with _event_loop_lock:
        _event_loop_refcnt -= 1
        if _event_loop_refcnt == 0:
            _event_loop.call_soon_threadsafe(_event_loop.stop)
            _event_loop = None  # type: ignore