Trait swiss_army_knife::hardware_optimized_spin_lock::SpinLock [−][src]
pub trait SpinLock: Default + Debug + Sync { 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); }
Expand description
A spin-lock API.
Required methods
fn acquire_spin_lock(&self)
fn acquire_spin_lock(&self)
Returns true if acquired spin lock.
fn try_to_acquire_spin_lock(&self) -> bool
fn try_to_acquire_spin_lock(&self) -> bool
Returns true if acquired spin lock.
fn unlock_spin_lock(&self)
fn unlock_spin_lock(&self)
Unlocks the spin lock.
fn is_unlocked(&self) -> bool
fn is_unlocked(&self) -> bool
Returns true if unlocked.
fn forcibly_unlock_spin_lock(&self)
fn forcibly_unlock_spin_lock(&self)
Forcibly unlocks the spin lock, even if it is currently unlocked.
Useful for working with persistent memory.