From a02d0a378eabbde1a36a5597266ad3a1b05fe338 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 30 Dec 2020 04:12:48 +0100 Subject: [PATCH] Fix race in enqueuing expired tasks. --- embassy/src/executor/mod.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/embassy/src/executor/mod.rs b/embassy/src/executor/mod.rs index facd71d1..5e835476 100644 --- a/embassy/src/executor/mod.rs +++ b/embassy/src/executor/mod.rs @@ -216,7 +216,8 @@ impl Executor { unsafe { if self.alarm.is_some() { self.timer_queue.dequeue_expired(Instant::now(), |p| { - self.enqueue(p); + let header = &*p; + header.enqueue(); }); }