Commit 740cbe9e authored by Max Kellermann's avatar Max Kellermann

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.
parent ed890a27
...@@ -272,9 +272,8 @@ EventLoop::Run() noexcept ...@@ -272,9 +272,8 @@ EventLoop::Run() noexcept
#endif #endif
assert(IsInside()); assert(IsInside());
assert(!quit);
#ifdef HAVE_THREADED_EVENT_LOOP #ifdef HAVE_THREADED_EVENT_LOOP
assert(alive); assert(alive || quit);
assert(busy); assert(busy);
wake_event.Schedule(SocketEvent::READ); wake_event.Schedule(SocketEvent::READ);
...@@ -299,7 +298,7 @@ EventLoop::Run() noexcept ...@@ -299,7 +298,7 @@ EventLoop::Run() noexcept
steady_clock_cache.flush(); steady_clock_cache.flush();
do { while (!quit) {
again = false; again = false;
/* invoke timers */ /* invoke timers */
...@@ -361,7 +360,7 @@ EventLoop::Run() noexcept ...@@ -361,7 +360,7 @@ EventLoop::Run() noexcept
socket_event.Dispatch(); socket_event.Dispatch();
} }
} while (!quit); }
#ifdef HAVE_THREADED_EVENT_LOOP #ifdef HAVE_THREADED_EVENT_LOOP
#ifndef NDEBUG #ifndef NDEBUG
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment