Report backtraces of pending conditions when deterministic executor illegally parks

Co-Authored-By: Max Brunsfeld <maxbrunsfeld@gmail.com>
This commit is contained in:
Nathan Sobo 2022-01-06 13:33:55 -07:00
parent 2dbee1d914
commit 943571af2a
3 changed files with 108 additions and 58 deletions

View file

@ -2660,8 +2660,6 @@ impl<T: Entity> ModelHandle<T> {
loop {
{
let cx = cx.borrow();
let executor = cx.foreground();
let cx = cx.as_ref();
if predicate(
handle
@ -2672,15 +2670,13 @@ impl<T: Entity> ModelHandle<T> {
) {
break;
}
if executor.parking_forbidden() && executor.would_park() {
panic!("parked while waiting on condition");
}
}
cx.borrow().foreground().start_waiting();
rx.recv()
.await
.expect("model dropped with pending condition");
cx.borrow().foreground().finish_waiting();
}
})
.await
@ -2920,9 +2916,11 @@ impl<T: View> ViewHandle<T> {
}
}
cx.borrow().foreground().start_waiting();
rx.recv()
.await
.expect("view dropped with pending condition");
cx.borrow().foreground().finish_waiting();
}
})
.await