check isStopped between each task

This commit is contained in:
Evan Tschannen 2021-03-18 10:49:24 -07:00
parent e825008431
commit c53dd4a46f
1 changed files with 4 additions and 1 deletions

View File

@ -1129,13 +1129,16 @@ public:
});
self->mutex.leave();
for (auto& t : self->instantTasks) {
while (self->orderedTasks.size()) {
while (self->orderedTasks.size() && !self->isStopped) {
Task o = std::move(self->orderedTasks.front());
self->orderedTasks.pop_front();
self->time = o.time;
self->execTask(o);
self->yielded = false;
}
if (self->isStopped) {
break;
}
self->execTask(t);
self->yielded = false;
}