pub struct Spinlock<T> { /* private fields */ }Expand description
Spinlock implements latch-and-spin mechanism for non-blocking concurrency.
It uses AtomicU32 for:
- ref-count, bits [0-61].
- latch flag, bit 62.
- lock flag, bit 63.
Implementations§
Auto Trait Implementations§
impl<T> !Freeze for Spinlock<T>
impl<T> RefUnwindSafe for Spinlock<T>where
T: RefUnwindSafe,
impl<T> Send for Spinlock<T>where
T: Send,
impl<T> Sync for Spinlock<T>where
T: Sync,
impl<T> Unpin for Spinlock<T>where
T: Unpin,
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