diff options
| author | datdenkikniet <jcdra1@gmail.com> | 2025-03-13 22:11:08 +0100 |
|---|---|---|
| committer | Emil Fresk <emil.fresk@gmail.com> | 2025-03-16 11:19:22 +0000 |
| commit | daf977dcff780b70897d4e64d6594ecdaa3f3282 (patch) | |
| tree | 302145a479d476db44851a4628c0d09bf233b481 /rtic-sync/src | |
| parent | 404c30d62059755d1bb7e92b8b728ca8fe763974 (diff) | |
Blah
Diffstat (limited to 'rtic-sync/src')
| -rw-r--r-- | rtic-sync/src/channel.rs | 3 |
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)) |
