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

Returns true if acquired spin lock.

Returns true if acquired spin lock.

Unlocks the spin lock.

Returns true if locked (but not necessarily by this thread).

Returns true if unlocked.

Forcibly unlocks the spin lock, even if it is currently unlocked.

Useful for working with persistent memory.

Implementors