aboutsummaryrefslogtreecommitdiff
path: root/rtic-sync/src
diff options
context:
space:
mode:
Diffstat (limited to 'rtic-sync/src')
-rw-r--r--rtic-sync/src/channel.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/rtic-sync/src/channel.rs b/rtic-sync/src/channel.rs
index a788880..d5574d0 100644
--- a/rtic-sync/src/channel.rs
+++ b/rtic-sync/src/channel.rs
@@ -363,7 +363,8 @@ impl<T, const N: usize> Sender<'_, T, N> {
}
// SAFETY: `free_slot_ptr` is valid for writes, as `free_slot_ptr` is still alive.
- let slot = unsafe { free_slot_ptr.replace(None, cs) };
+ let slot = unsafe { free_slot_ptr.replace(None, cs) }
+ .or_else(|| self.0.access(cs).freeq.pop_back());
if let Some(slot) = slot {
Poll::Ready(Ok(slot))