-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
This seems actually not stable(Dead lock) #143
Comments
Thanks for the report! This seems tricky to replicate, let me see if I can |
Simple reproduction found in smol-rs/async-lock#91:
The reason is explained by clippy:
No feedback that one of the listeners was dropped. |
Thanks for the repro! I would like to take some time to set up look tests for this. |
The test is simple: #[test]
fn drop_notified3() {
let event = Event::new();
let l1 = pin!(event.listen());
let mut l2 = pin!(event.listen());
drop(l1);
assert_eq!(event.notify(1), 1);
assert!(is_notified(&mut l2));
} I'm trying to come up with a fix now. |
Hm... looks like false alarm, it didn't work because |
Quick update on this. I've gotten my hands on hardware that's good enough that I can use it to run Loom tests. Standby while I fully instrument this crate. |
I forgot to run notify() when I rewrote this example without unsafe code. It looks like it prevents deadlocks in this mutex implementation. I believe this fixes #143. Signed-off-by: John Nunley <[email protected]>
I forgot to run notify() when I rewrote this example without unsafe code. It looks like it prevents deadlocks in this mutex implementation. I believe this fixes #143. Signed-off-by: John Nunley <[email protected]>
I forgot to run notify() when I rewrote this example without unsafe code. It looks like it prevents deadlocks in this mutex implementation. I believe this fixes #143. Signed-off-by: John Nunley <[email protected]>
https://github.com/beckend/event-listener/tree/event_listener_bug
cargo run --release --example mutex
https://github.com/beckend/event-listener/blob/event_listener_bug/examples/mutex.rs#L127-L151
It dead locks.
The text was updated successfully, but these errors were encountered: