Struct swiss_army_knife::hardware_optimized_spin_lock::IntelHardwareOptimizedLockSpinLock[][src]

pub struct IntelHardwareOptimizedLockSpinLock(_);
Expand description

An efficient, CAS-free unfair spin lock that uses an atomic exchange and only requires one byte of memory.

Uses Intel TSX Hardware Lock Elision (which should be backwards compatible) to create a spin lock. Inspiration from https://github.com/cyfdecyf/spinlock, https://software.intel.com/en-us/articles/tsx-anti-patterns-in-lock-elision-code and http://locklessinc.com/articles/locks/.

Trait Implementations

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

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. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.