fix(driver-base): run the wait hook between the steps block_on takes, as the waits it replaces did
This commit is contained in:
1 parent
445e0d679b
commit
670e31e4af
1 file changed
+3
-1
@@ -52,13 +52,15 @@ pub fn poll_once<F: Future + ?Sized>(future: Pin<&mut F>) -> Poll<F::Output> {
|
||||
}
|
||||
|
||||
/// Run `future` to completion on this CPU, stepping it until it is ready;
|
||||
/// the attach-time driver of the same work [`Stepped`] runs per poll.
|
||||
/// the attach-time driver of the same work [`Stepped`] runs per poll. Each
|
||||
/// pending step is a wait, so the [`crate::on_wait`] hook runs between steps.
|
||||
pub fn block_on<F: Future>(future: F) -> F::Output {
|
||||
let mut future = core::pin::pin!(future);
|
||||
loop {
|
||||
if let Poll::Ready(output) = poll_once(future.as_mut()) {
|
||||
return output;
|
||||
}
|
||||
crate::waiting();
|
||||
core::hint::spin_loop();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user