event/Loop: remove failing assert()

The `assert(!quit)` can fail if the `EventThread` gets stopped before
it enters `EventLoop::Run()`. There is a similar problem with `alive`,
which gets reset by `EventThread::Stop()`.

If that happens, then `EventLoop::Run()` should return immediately
without handling any events.
This commit is contained in:
Max Kellermann 2023-05-22 18:12:54 +02:00
parent ed890a273a
commit 740cbe9e02
1 changed files with 3 additions and 4 deletions

View File

@ -272,9 +272,8 @@ EventLoop::Run() noexcept
#endif
assert(IsInside());
assert(!quit);
#ifdef HAVE_THREADED_EVENT_LOOP
assert(alive);
assert(alive || quit);
assert(busy);
wake_event.Schedule(SocketEvent::READ);
@ -299,7 +298,7 @@ EventLoop::Run() noexcept
steady_clock_cache.flush();
do {
while (!quit) {
again = false;
/* invoke timers */
@ -361,7 +360,7 @@ EventLoop::Run() noexcept
socket_event.Dispatch();
}
} while (!quit);
}
#ifdef HAVE_THREADED_EVENT_LOOP
#ifndef NDEBUG