Skip to content

Commit 280fb50

Browse files
committed
rtic-sync: improve some more docs
1 parent 14c1461 commit 280fb50

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

rtic-sync/src/channel/channel.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,14 @@ use super::{Receiver, Sender};
1818
pub(crate) type WaitQueueData = (Waker, FreeSlotPtr);
1919
pub(crate) type WaitQueue = DoublyLinkedList<WaitQueueData>;
2020

21+
/// A free slot.
2122
#[derive(Debug)]
2223
pub(crate) struct FreeSlot(u8);
2324

2425
/// A pointer to a free slot.
26+
///
27+
/// This struct exists to enforce lifetime/safety requirements, and to ensure
28+
/// that [`FreeSlot`]s can only be created/updated by this module.
2529
#[derive(Clone)]
2630
pub(crate) struct FreeSlotPtr(*mut Option<FreeSlot>);
2731

rtic-sync/src/channel/sender.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ impl<T, const N: usize> Sender<'_, T, N> {
171171

172172
// If our link is popped, then:
173173
// 1. We were popped by `return_free_lot` and provided us with a slot.
174-
// 2. We were popped by `Receiver::drop` and it did not provide us with a slot, and the channel is closed.
174+
// 2. We were popped by `drop_receiver` and it did not provide us with a slot, and the channel is closed.
175175
if let Some(slot) = slot {
176176
Poll::Ready(Ok(slot))
177177
} else {

0 commit comments

Comments
 (0)