feat: do not cause memory corruption if remove_from_list (safe function) is called multiple times

This commit is contained in:
Oleksandr Babak 2025-04-02 17:57:48 +02:00 committed by datdenkikniet
parent c3a5cf0a47
commit 08a0d7f53a

View file

@ -140,6 +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(|_| {
// Make sure all previous writes are visible
core::sync::atomic::fence(Ordering::SeqCst);