pub struct SpinLock<T> { /* private fields */ }Expand description
A simple spin lock.
The lock is acquired via a compare-exchange loop and released on guard drop.
§Safety
This type is Send/Sync when T: Send and relies on correct atomic behavior.
As with any spin lock, make sure lock hold times are short.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T> !Freeze for SpinLock<T>
impl<T> !RefUnwindSafe for SpinLock<T>
impl<T> Unpin for SpinLock<T>where
T: Unpin,
impl<T> UnsafeUnpin for SpinLock<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for SpinLock<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