pub struct FutexMutex<T> { /* private fields */ }Expand description
A futex-backed mutex on Linux with adaptive spinning; falls back to atomic spin on non-Linux.
Implementations§
Source§impl<T> FutexMutex<T>
impl<T> FutexMutex<T>
Sourcepub fn lock(&self) -> FutexMutexGuard<'_, T>
pub fn lock(&self) -> FutexMutexGuard<'_, T>
Lock the mutex with adaptive spinning.
Sourcepub fn try_lock(&self) -> Option<FutexMutexGuard<'_, T>>
pub fn try_lock(&self) -> Option<FutexMutexGuard<'_, T>>
Try to lock the mutex without spinning or blocking.
Returns Some(FutexMutexGuard) if successful, None otherwise.
Trait Implementations§
Source§impl<T> Debug for FutexMutex<T>
impl<T> Debug for FutexMutex<T>
impl<T: Send> Send for FutexMutex<T>
impl<T: Send> Sync for FutexMutex<T>
Auto Trait Implementations§
impl<T> !Freeze for FutexMutex<T>
impl<T> !RefUnwindSafe for FutexMutex<T>
impl<T> Unpin for FutexMutex<T>where
UnsafeCell<T>: Unpin,
impl<T> UnsafeUnpin for FutexMutex<T>where
UnsafeCell<T>: UnsafeUnpin,
impl<T> UnwindSafe for FutexMutex<T>where
UnsafeCell<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