pub struct Mutex<T> { /* private fields */ }
Expand description
Wrapper around a std::sync::Mutex
which uses a thread local variable in order to check for
lock hierachy violations.
Each Mutex is assigned a level. Mutecies with higher levels must be acquired before mutices with lower levels.
Implementations§
Source§impl<T> Mutex<T>
impl<T> Mutex<T>
pub fn with_level(t: T, level: u32) -> Self
pub fn lock(&self) -> Result<MutexGuard<'_, T>, PoisonError<MutexGuard<'_, T>>>
Auto Trait Implementations§
impl<T> !Freeze for Mutex<T>
impl<T> RefUnwindSafe for Mutex<T>
impl<T> Send for Mutex<T>where
T: Send,
impl<T> Sync for Mutex<T>where
T: Send,
impl<T> Unpin for Mutex<T>where
T: Unpin,
impl<T> UnwindSafe for Mutex<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more