Merge pull request #4490 from Brezak/waker-registration-docs

embassy-sync: Update `MultiWakerRegistration::register` docs
This commit is contained in:
Ulf Lilleengen 2025-08-04 09:17:50 +00:00 committed by GitHub
commit a8cb8a7fe1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -15,7 +15,9 @@ impl<const N: usize> MultiWakerRegistration<N> {
Self { wakers: Vec::new() }
}
/// Register a waker. If the buffer is full the function returns it in the error
/// Register a waker.
///
/// If the buffer is full, [wakes all the wakers](Self::wake), clears its buffer and registers the waker.
pub fn register(&mut self, w: &Waker) {
// If we already have some waker that wakes the same task as `w`, do nothing.
// This avoids cloning wakers, and avoids unnecessary mass-wakes.