aboutsummaryrefslogtreecommitdiff
path: root/rtic-common
diff options
context:
space:
mode:
authorOleksandr Babak <alexanderbabak@proton.me>2025-04-02 21:17:33 +0200
committerdatdenkikniet <38322042+datdenkikniet@users.noreply.github.com>2025-04-03 12:18:11 +0000
commite10866ff30c0f8e4aea9dd5589dd94c7e0864b49 (patch)
treec18087980612b562bab5a598d3ca414442a1eb37 /rtic-common
parentc9eefd2e25114bc52a3eb703a3550b7d53f373cc (diff)
fix: check if link is already popped when removing it inside the critical section
Diffstat (limited to 'rtic-common')
-rw-r--r--rtic-common/src/wait_queue.rs7
1 files 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<T: Clone> Link<T> {
/// Remove this link from a linked list.
pub fn remove_from_list(&self, list: &DoublyLinkedList<T>) {
- 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);