Fix race in enqueuing expired tasks.

This commit is contained in:
Dario Nieuwenhuis 2020-12-30 04:12:48 +01:00
parent bb6f25d010
commit a02d0a378e

View file

@ -216,7 +216,8 @@ impl Executor {
unsafe { unsafe {
if self.alarm.is_some() { if self.alarm.is_some() {
self.timer_queue.dequeue_expired(Instant::now(), |p| { self.timer_queue.dequeue_expired(Instant::now(), |p| {
self.enqueue(p); let header = &*p;
header.enqueue();
}); });
} }