There was an error while loading. Please reload this page.
1 parent 7b60b1a commit e3a5247Copy full SHA for e3a5247
1 file changed
src/notifier.rs
@@ -32,10 +32,15 @@ impl Future for Notifier {
32
type Output = ();
33
34
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
35
+ if self.ready() {
36
+ return Poll::Ready(());
37
+ }
38
+ self.wakers.register(cx.waker());
39
+ // Re-check after registering to close the lost-wakeup window between the
40
+ // first check and the waker registration.
41
if self.ready() {
42
Poll::Ready(())
43
} else {
- self.wakers.register(cx.waker());
44
Poll::Pending
45
}
46
0 commit comments