fix: move the popped check after the fence

This commit is contained in:
Oleksandr Babak 2025-04-03 10:10:10 +02:00 committed by datdenkikniet
parent e10866ff30
commit be6648c0ee

View file

@ -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);