Commit 906e82f6 authored by Max Kellermann's avatar Max Kellermann

event/Loop: fix assertion failure due to wrong "busy" value

If an InjectEvent callback schedules a timer, the loop will restart, but the "busy" flag is still false. The fix is to move the "again" check before the "busy" setting.
parent bcb7e954
......@@ -326,15 +326,19 @@ EventLoop::Run() noexcept
{
const std::lock_guard<Mutex> lock(mutex);
HandleInject();
#endif
if (again)
/* re-evaluate timers because one of
the DeferEvents may have added a
new timeout */
continue;
#ifdef HAVE_THREADED_EVENT_LOOP
busy = false;
}
#endif
if (again)
/* re-evaluate timers because one of the
DeferEvents may have added a new timeout */
continue;
/* wait for new event */
Wait(timeout);
......
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