Add wait_until_* functionality to Waiter

This commit is contained in:
Chen Chengjun
2024-09-14 10:13:14 +08:00
committed by Tate, Hongliang Tian
parent 6a5a5b4d3d
commit 1873bb7a3f
5 changed files with 140 additions and 62 deletions

View File

@ -59,7 +59,7 @@ fn spawn_background_poll_thread(iface: Arc<Iface>) {
}
let duration = Duration::from_millis(next_poll_at_ms - now_as_ms);
wait_queue.wait_until_or_timeout(
let _ = wait_queue.wait_until_or_timeout(
// If `iface_ext.next_poll_at_ms()` changes to an earlier time, we will end the
// waiting.
|| (iface_ext.next_poll_at_ms()? < next_poll_at_ms).then_some(()),