fix: check if link is already popped when removing it inside the critical section

This commit is contained in:
Oleksandr Babak 2025-04-02 21:17:33 +02:00 committed by datdenkikniet
parent c9eefd2e25
commit e10866ff30

View file

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