Hi,
I'm currently through this project to get some inspiration on how to improve my own Bluetooth stack and I think I've stumbled on a small bug.
Currently the implementation of the ControllerState looks like this:
struct ControllerState<const SLOTS: usize> {
...
waker: AtomicWaker,
}
impl<const SLOTS: usize> ControllerState<SLOTS> {
async fn acquire(&self, op: cmd::Opcode, event: *mut [u8]) -> (&Signal<NoopRawMutex, CommandResponse>, usize) {
...
poll_fn(|cx| match self.acquire_slot(op, event) {
Some(ret) => Poll::Ready(ret),
None => {
self.waker.register(cx.waker()); // <-- Waker is registered here if no viable slot is available
Poll::Pending
}
})
.await
}
}
However, the implementation never calls self.waker.wake(). Unless I'm mistaken, this should cause the ControllerState::acquire to potentially stall indefinitely.
I think the correct action is to add a self.waker.wake() call to ControllerState::release_slot.
Hi,
I'm currently through this project to get some inspiration on how to improve my own Bluetooth stack and I think I've stumbled on a small bug.
Currently the implementation of the
ControllerStatelooks like this:However, the implementation never calls
self.waker.wake(). Unless I'm mistaken, this should cause theControllerState::acquireto potentially stall indefinitely.I think the correct action is to add a
self.waker.wake()call toControllerState::release_slot.