1 #[allow(dead_code)] // Depending on the compilation flags some variants are never used
2 #[derive(Debug, PartialEq, Eq)]
3 pub(crate) enum LockHeldState {
6 #[cfg(any(feature = "_bench_unstable", not(test)))]
10 pub(crate) trait LockTestExt {
11 fn held_by_thread(&self) -> LockHeldState;
14 #[cfg(all(feature = "std", not(feature = "_bench_unstable"), test))]
16 #[cfg(all(feature = "std", not(feature = "_bench_unstable"), test))]
17 pub use debug_sync::*;
18 #[cfg(all(feature = "std", not(feature = "_bench_unstable"), test))]
19 // Note that to make debug_sync's regex work this must not contain `debug_string` in the module name
20 mod test_lockorder_checks;
22 #[cfg(all(feature = "std", any(feature = "_bench_unstable", not(test))))]
23 pub(crate) mod fairrwlock;
24 #[cfg(all(feature = "std", any(feature = "_bench_unstable", not(test))))]
25 pub use {std::sync::{Arc, Mutex, Condvar, MutexGuard, RwLock, RwLockReadGuard, RwLockWriteGuard}, fairrwlock::FairRwLock};
27 #[cfg(all(feature = "std", any(feature = "_bench_unstable", not(test))))]
30 impl<T> LockTestExt for Mutex<T> {
32 fn held_by_thread(&self) -> LockHeldState { LockHeldState::Unsupported }
34 impl<T> LockTestExt for RwLock<T> {
36 fn held_by_thread(&self) -> LockHeldState { LockHeldState::Unsupported }
40 #[cfg(not(feature = "std"))]
42 #[cfg(not(feature = "std"))]
43 pub use nostd_sync::*;