Trait spin_locks::SpinLock
[−]
[src]
pub trait SpinLock: Default { fn acquire_spin_lock(&self); fn try_to_acquire_spin_lock(&self) -> bool; fn unlock_spin_lock(&self); fn is_locked(&self) -> bool; fn is_unlocked(&self) -> bool; fn forcibly_unlock_spin_lock(&self); }
A spin-lock API.
Required Methods
fn acquire_spin_lock(&self)
Returns true if acquired spin lock.
fn try_to_acquire_spin_lock(&self) -> bool
Returns true if acquired spin lock.
fn unlock_spin_lock(&self)
Unlocks the spin lock.
fn is_locked(&self) -> bool
Returns true if locked (but not necessarily by this thread).
fn is_unlocked(&self) -> bool
Returns true if unlocked.
fn forcibly_unlock_spin_lock(&self)
Forcibly unlocks the spin lock, even if it is currently unlocked. Useful for working with persistent memory.
Implementors
impl SpinLock for AtomicBoolSpinLock
impl SpinLock for IntelTsxHleSpinLock