pub struct SemMutex<T> { /* private fields */ }
Expand description
Semaphore based implementation, often called Benaphore
Note that it is not recursive
Trait Implementations§
Source§impl<T: Semaphore> Mutex for Mutex<T>
impl<T: Semaphore> Mutex for Mutex<T>
Source§fn lock(&self) -> MutexGuard<'_, Self>
fn lock(&self) -> MutexGuard<'_, Self>
Acquires lock, returning guard that unlocks self on drop. Read more
Source§fn try_lock(&self) -> Option<MutexGuard<'_, Self>>
fn try_lock(&self) -> Option<MutexGuard<'_, Self>>
Attempts to acquire lock, returning guard that unlocks self on drop. Read more
Source§fn unlock(&self, _: GuardToken)
fn unlock(&self, _: GuardToken)
Tells how to perform unlock. Read more
Auto Trait Implementations§
impl<T> !Freeze for Mutex<T>
impl<T> RefUnwindSafe for Mutex<T>where
T: RefUnwindSafe,
impl<T> Send for Mutex<T>where
T: Send,
impl<T> Sync for Mutex<T>where
T: Sync,
impl<T> Unpin for Mutex<T>where
T: Unpin,
impl<T> UnwindSafe for Mutex<T>where
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