condvar.rs |
|
43276 |
deadlock.rs |
\[Experimental\] Deadlock detection
This feature is optional and can be enabled via the `deadlock_detection` feature flag.
# Example
```
#[cfg(feature = "deadlock_detection")]
{ // only for #[cfg]
use std::thread;
use std::time::Duration;
use parking_lot::deadlock;
// Create a background thread which checks for deadlocks every 10s
thread::spawn(move || {
loop {
thread::sleep(Duration::from_secs(10));
let deadlocks = deadlock::check_deadlock();
if deadlocks.is_empty() {
continue;
}
println!("{} deadlocks detected", deadlocks.len());
for (i, threads) in deadlocks.iter().enumerate() {
println!("Deadlock #{}", i);
for t in threads {
println!("Thread Id {:#?}", t.thread_id());
println!("{:#?}", t.backtrace());
}
}
}
});
} // only for #[cfg]
``` |
6113 |
elision.rs |
|
3437 |
fair_mutex.rs |
|
8830 |
lib.rs |
This library provides implementations of `Mutex`, `RwLock`, `Condvar` and
`Once` that are smaller, faster and more flexible than those in the Rust
standard library. It also provides a `ReentrantMutex` type. |
1977 |
mutex.rs |
|
10039 |
once.rs |
|
13910 |
raw_fair_mutex.rs |
|
1634 |
raw_mutex.rs |
|
11796 |
raw_rwlock.rs |
|
38174 |
remutex.rs |
|
4957 |
rwlock.rs |
|
19469 |
util.rs |
|
1006 |