ScheduledWorkItem::ScheduleClear: remove item from runnable queue

The existing behavior is unexpected: if the work item is already on the
runnable queue, it will still be triggered after a call to ScheduleClear().
This can lead to race conditions.
This commit is contained in:
Beat Küng authored and Daniel Agar committed 2020-03-09 08:06:00 -04:00
1 parent 977b80cee9
commit 18bc6cf872
4 files changed
+15

No files matched your search

@@ -89,6 +89,14 @@ WorkItem::Deinit()
}
}
void
WorkItem::ScheduleClear()
{
if (_wq != nullptr) {
_wq->Remove(this);
}
}
float
WorkItem::elapsed_time() const
{