aboutsummaryrefslogtreecommitdiff
path: root/rtic-common
diff options
context:
space:
mode:
authorOleksandr Babak <alexanderbabak@proton.me>2025-04-03 10:10:10 +0200
committerdatdenkikniet <38322042+datdenkikniet@users.noreply.github.com>2025-04-03 12:18:11 +0000
commitbe6648c0eefebc1b346966892e4da8ce435e5bf8 (patch)
tree64253df8adb0271a0a7f509b7ad8809339cbf6da /rtic-common
parente10866ff30c0f8e4aea9dd5589dd94c7e0864b49 (diff)
fix: move the popped check after the fence
Diffstat (limited to 'rtic-common')
-rw-r--r--rtic-common/src/wait_queue.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/rtic-common/src/wait_queue.rs b/rtic-common/src/wait_queue.rs
index 8a3f80e..0f3a59d 100644
--- a/rtic-common/src/wait_queue.rs
+++ b/rtic-common/src/wait_queue.rs
@@ -141,11 +141,12 @@ impl<T: Clone> Link<T> {
/// Remove this link from a linked list.
pub fn remove_from_list(&self, list: &DoublyLinkedList<T>) {
cs::with(|_| {
+ // Make sure all previous writes are visible
+ core::sync::atomic::fence(Ordering::SeqCst);
+
if self.is_popped() {
return;
}
- // Make sure all previous writes are visible
- core::sync::atomic::fence(Ordering::SeqCst);
let prev = self.prev.load(Self::R);
let next = self.next.load(Self::R);