Fix TaskScheduler.waitAndProcess to not block if any tasks were resumed.

In situations where no events were involved in an multi-task scenario, the old behavior could lead to the process to starve or hang until an event arrived.
This commit is contained in:
Sönke Ludwig 2016-12-10 14:13:44 +01:00
parent df69c86bd4
commit bf2edc7fb2
2 changed files with 20 additions and 8 deletions

View file

@ -1131,7 +1131,7 @@ package(vibe) void performIdleProcessing()
again = s_idleHandler();
else again = false;
again = (s_scheduler.schedule() || again) && !getExitFlag();
again = (s_scheduler.schedule() == ScheduleStatus.busy || again) && !getExitFlag();
if (again) {
auto er = eventDriver.core.processEvents(0.seconds);