mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-16 21:05:35 +01:00
fix: check if link is already popped when removing it inside the critical section
This commit is contained in:
parent
c9eefd2e25
commit
e10866ff30
1 changed files with 3 additions and 4 deletions
|
|
@ -140,11 +140,10 @@ impl<T: Clone> Link<T> {
|
||||||
|
|
||||||
/// Remove this link from a linked list.
|
/// Remove this link from a linked list.
|
||||||
pub fn remove_from_list(&self, list: &DoublyLinkedList<T>) {
|
pub fn remove_from_list(&self, list: &DoublyLinkedList<T>) {
|
||||||
if self.is_popped() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
cs::with(|_| {
|
cs::with(|_| {
|
||||||
|
if self.is_popped() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
// Make sure all previous writes are visible
|
// Make sure all previous writes are visible
|
||||||
core::sync::atomic::fence(Ordering::SeqCst);
|
core::sync::atomic::fence(Ordering::SeqCst);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue