embassy-sync: fix clear() to wake senders
This commit is contained in:
parent
51d87c6603
commit
e2ddba92f7
@ -562,6 +562,9 @@ impl<T, const N: usize> ChannelState<T, N> {
|
||||
}
|
||||
|
||||
fn clear(&mut self) {
|
||||
if self.queue.is_full() {
|
||||
self.senders_waker.wake();
|
||||
}
|
||||
self.queue.clear();
|
||||
}
|
||||
|
||||
|
||||
@ -411,6 +411,9 @@ where
|
||||
}
|
||||
|
||||
fn clear(&mut self) {
|
||||
if self.queue.len() == self.queue.capacity() {
|
||||
self.senders_waker.wake();
|
||||
}
|
||||
self.queue.clear();
|
||||
}
|
||||
|
||||
|
||||
@ -421,6 +421,9 @@ impl<T: Clone, const CAP: usize, const SUBS: usize, const PUBS: usize> PubSubSta
|
||||
}
|
||||
|
||||
fn clear(&mut self) {
|
||||
if self.is_full() {
|
||||
self.publisher_wakers.wake();
|
||||
}
|
||||
self.queue.clear();
|
||||
}
|
||||
|
||||
|
||||
@ -287,6 +287,9 @@ impl State {
|
||||
}
|
||||
|
||||
fn clear(&mut self) {
|
||||
if self.full {
|
||||
self.receive_waker.wake();
|
||||
}
|
||||
self.front = 0;
|
||||
self.back = 0;
|
||||
self.full = false;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user