From e10866ff30c0f8e4aea9dd5589dd94c7e0864b49 Mon Sep 17 00:00:00 2001 From: Oleksandr Babak Date: Wed, 2 Apr 2025 21:17:33 +0200 Subject: fix: check if link is already popped when removing it inside the critical section --- rtic-common/src/wait_queue.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/rtic-common/src/wait_queue.rs b/rtic-common/src/wait_queue.rs index 4debcb9..8a3f80e 100644 --- a/rtic-common/src/wait_queue.rs +++ b/rtic-common/src/wait_queue.rs @@ -140,11 +140,10 @@ impl Link { /// Remove this link from a linked list. pub fn remove_from_list(&self, list: &DoublyLinkedList) { - if self.is_popped() { - return; - } - cs::with(|_| { + if self.is_popped() { + return; + } // Make sure all previous writes are visible core::sync::atomic::fence(Ordering::SeqCst); -- cgit v1.2.3