rust-lang / futures-rs

Zero-cost asynchronous programming in Rust
https://rust-lang.github.io/futures-rs/
Apache License 2.0
5.42k stars 627 forks source link

Deadlock detection for futures::lock::Mutex #2133

Open tmandry opened 4 years ago

tmandry commented 4 years ago

It would be really nice if Mutex had deadlock detection (including via a feature flag). Especially in an async context where it's hard to peer into the state of tasks, these can be exceptionally hard to debug.

parking_lot does this for its synchronous locks, though it requires you to trigger detection manually on another thread.

cc @ctiller

ryankurte commented 4 years ago

v relatable problem this one, you may find no_deadlocks useful for std::sync::* objects if you have / can use them.