Struct alacritty_terminal::sync::FairMutex
source · pub struct FairMutex<T> { /* private fields */ }
Expand description
A fair mutex.
Uses an extra lock to ensure that if one thread is waiting that it will get the lock before a single thread can re-lock it.
Implementations§
source§impl<T> FairMutex<T>
impl<T> FairMutex<T>
sourcepub fn lease(&self) -> MutexGuard<'_, ()>
pub fn lease(&self) -> MutexGuard<'_, ()>
Acquire a lease to reserve the mutex lock.
This will prevent others from acquiring a terminal lock, but block if anyone else is already holding a lease.
sourcepub fn lock(&self) -> MutexGuard<'_, T>
pub fn lock(&self) -> MutexGuard<'_, T>
Lock the mutex.
sourcepub fn lock_unfair(&self) -> MutexGuard<'_, T>
pub fn lock_unfair(&self) -> MutexGuard<'_, T>
Unfairly lock the mutex.
sourcepub fn try_lock_unfair(&self) -> Option<MutexGuard<'_, T>>
pub fn try_lock_unfair(&self) -> Option<MutexGuard<'_, T>>
Unfairly try to lock the mutex.
Auto Trait Implementations§
impl<T> !Freeze for FairMutex<T>
impl<T> !RefUnwindSafe for FairMutex<T>
impl<T> Send for FairMutex<T>where
T: Send,
impl<T> Sync for FairMutex<T>where
T: Send,
impl<T> Unpin for FairMutex<T>where
T: Unpin,
impl<T> UnwindSafe for FairMutex<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