pub struct OrderedMutex<T, L: LockAfter<UninterruptibleLock>> { /* private fields */ }
Expand description
A wrapper for mutex that requires a Locked
context to acquire.
This context must be of a level that precedes L
in the lock ordering graph
where L
is a level associated with this mutex.
Implementations§
Source§impl<T, L: LockAfter<UninterruptibleLock>> OrderedMutex<T, L>
impl<T, L: LockAfter<UninterruptibleLock>> OrderedMutex<T, L>
pub const fn new(t: T) -> Self
pub fn lock<'a, P>(
&'a self,
locked: &'a mut Locked<'_, P>,
) -> <Self as LockFor<L>>::Guard<'a>where
P: LockBefore<L>,
pub fn lock_and<'a, P>(
&'a self,
locked: &'a mut Locked<'_, P>,
) -> (<Self as LockFor<L>>::Guard<'a>, Locked<'a, L>)where
P: LockBefore<L>,
Trait Implementations§
Source§impl<T: Debug, L: LockAfter<UninterruptibleLock>> Debug for OrderedMutex<T, L>
impl<T: Debug, L: LockAfter<UninterruptibleLock>> Debug for OrderedMutex<T, L>
Source§impl<T: Default, L: LockAfter<UninterruptibleLock>> Default for OrderedMutex<T, L>
impl<T: Default, L: LockAfter<UninterruptibleLock>> Default for OrderedMutex<T, L>
Source§impl<T, L: LockAfter<UninterruptibleLock>> LockFor<L> for OrderedMutex<T, L>
impl<T, L: LockAfter<UninterruptibleLock>> LockFor<L> for OrderedMutex<T, L>
Auto Trait Implementations§
impl<T, L> !Freeze for OrderedMutex<T, L>
impl<T, L> !RefUnwindSafe for OrderedMutex<T, L>
impl<T, L> Send for OrderedMutex<T, L>
impl<T, L> Sync for OrderedMutex<T, L>
impl<T, L> Unpin for OrderedMutex<T, L>
impl<T, L> UnwindSafe for OrderedMutex<T, L>where
L: UnwindSafe,
T: UnwindSafe,
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