diff --git a/tokio/src/runtime/tests/loom_pool.rs b/tokio/src/runtime/tests/loom_pool.rs index fb42e1eb4..96ec92bd1 100644 --- a/tokio/src/runtime/tests/loom_pool.rs +++ b/tokio/src/runtime/tests/loom_pool.rs @@ -412,8 +412,8 @@ async fn multi_gated() { } poll_fn(move |cx| { + gate.waker.register_by_ref(cx.waker()); if gate.count.load(SeqCst) < 2 { - gate.waker.register_by_ref(cx.waker()); Poll::Pending } else { Poll::Ready(())