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.
This commit is contained in:
parent
bcb7e954e9
commit
906e82f600
@ -326,15 +326,19 @@ EventLoop::Run() noexcept
|
|||||||
{
|
{
|
||||||
const std::lock_guard<Mutex> lock(mutex);
|
const std::lock_guard<Mutex> lock(mutex);
|
||||||
HandleInject();
|
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;
|
busy = false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (again)
|
|
||||||
/* re-evaluate timers because one of the
|
|
||||||
DeferEvents may have added a new timeout */
|
|
||||||
continue;
|
|
||||||
|
|
||||||
/* wait for new event */
|
/* wait for new event */
|
||||||
|
|
||||||
Wait(timeout);
|
Wait(timeout);
|
||||||
|
Loading…
Reference in New Issue
Block a user