void () { assertEventQueueDispatchThread(); while (true) { try (AccessToken ignored = ThreadContext.resetThreadContext()) { if (dispatchNextEventIfAny() == null) break; } catch (InterruptedException e) { throw new RuntimeException(e); } } }