1
0
Fork 0
forked from wry/wry

it: wait for async engine and cpu worker to become idle

This commit is contained in:
Julian Orth 2024-09-28 22:26:01 +02:00
parent 58f82d889b
commit a9aad0c613
5 changed files with 59 additions and 3 deletions

View file

@ -1218,6 +1218,16 @@ impl State {
output.vblank();
}
}
#[cfg(feature = "it")]
pub async fn idle(&self) {
loop {
self.eng.idle().await;
if self.cpu_worker.wait_idle() {
break;
}
}
}
}
#[derive(Debug, Error)]