We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5933b2 commit 6752a1dCopy full SHA for 6752a1d
src/sync.rs
@@ -298,10 +298,10 @@ impl Future for CountDownLatch {
298
fn poll(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Self::Output> {
299
let &(ref remaining, _) = &*self.pair.clone();
300
if *remaining.lock().unwrap() > 0 {
301
- Poll::Ready(())
302
- } else {
303
self.waker.lock().unwrap().replace(cx.waker().clone());
304
Poll::Pending
+ } else {
+ Poll::Ready(())
305
}
306
307
@@ -477,7 +477,7 @@ async fn test_sync_future() {
477
let latch2 = latch.clone();
478
479
let _ = pub1.subscribe(Arc::new(Mutex::new(SubscriptionFunc::new(move |_| {
480
- println!("{:?}", "SS");
+ println!("{:?}", "test_sync_future");
481
latch2.countdown();
482
}))));
483
0 commit comments