Crate lock_hierarchy

Source
Expand description

This crate offers debug assertions for violations of lock hierarchies. No runtime overhead or protection occurs for release builds.

Each lock is assigned a level. Locks with higher levels must be acquired before locks with lower levels. Both RwLock and Mutex use the same hierarchy.

Structsยง

Mutex
Wrapper around a std::sync::Mutex which uses a thread local variable in order to check for lock hierarchy violations in debug builds.
MutexGuard
RwLock
Wrapper around a std::sync::RwLock which uses a thread local variable in order to check for lock hierarchy violations in debug builds.
RwLockReadGuard
RwLockWriteGuard