mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-18 05:45:19 +01:00
Fix #780
This commit is contained in:
parent
1123fd8731
commit
0a01fde4bd
1 changed files with 7 additions and 7 deletions
|
|
@ -432,16 +432,16 @@ impl<T, const N: usize> Receiver<'_, T, N> {
|
||||||
critical_section::with(|cs| {
|
critical_section::with(|cs| {
|
||||||
assert!(!self.0.access(cs).freeq.is_full());
|
assert!(!self.0.access(cs).freeq.is_full());
|
||||||
unsafe { self.0.access(cs).freeq.push_back_unchecked(rs) }
|
unsafe { self.0.access(cs).freeq.push_back_unchecked(rs) }
|
||||||
});
|
|
||||||
|
|
||||||
fence(Ordering::SeqCst);
|
fence(Ordering::SeqCst);
|
||||||
|
|
||||||
// If someone is waiting in the WaiterQueue, wake the first one up.
|
// If someone is waiting in the WaiterQueue, wake the first one up.
|
||||||
if let Some(wait_head) = self.0.wait_queue.pop() {
|
if let Some(wait_head) = self.0.wait_queue.pop() {
|
||||||
wait_head.wake();
|
wait_head.wake();
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(r)
|
Ok(r)
|
||||||
|
})
|
||||||
} else if self.is_closed() {
|
} else if self.is_closed() {
|
||||||
Err(ReceiveError::NoSender)
|
Err(ReceiveError::NoSender)
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue