Installation
Deloxide’s default build includes active deadlock detection:
[dependencies]
deloxide = "1.1"
Then initialize it once, before creating the locks and threads you want to observe:
#![allow(unused)]
fn main() {
extern crate deloxide;
use deloxide::Deloxide;
Deloxide::new()
.callback(|report| eprintln!("{report:#?}"))
.start()
.expect("start Deloxide");
}
Replace the synchronization on the suspicious path with Deloxide’s Mutex,
RwLock, and Condvar. Their guards behave like familiar Rust lock guards.
Using deloxide::thread also records thread lifecycle information.
Optional Cargo features add deeper investigation tools:
[dependencies]
deloxide = { version = "1.1", features = [
"logging-and-visualization",
"lock-order-graph",
"stress-test",
] }
Start with the default build. Add logging when you need a timeline, lock-order analysis when you want to find risky acquisition patterns, and stress testing when a bug rarely reproduces. Choosing a mode explains the difference.
Rust is the primary interface. C projects can build Deloxide as a library and
use include/deloxide.h; see
C integration.
For exact methods and types, use the Rust API documentation.