oa::Spinlock

oa::Spinlock — PAUSE spinlock + SFENCE unlock Replaces std::mutex for short critical sections. Uncontended: ~1-2ns (vs ~18-22ns for futex). Contended: PAUSE loop stays in userspace (no kernel call).

Public Methods

void oa::Spinlock::lock()
bool oa::Spinlock::tryLock()
void oa::Spinlock::unlock()

Public Data Members

stateAtomicfield

Public Method Documentation

void oa::Spinlock::lock()
No public source comment is attached to this declaration.

Returns

void

The declared return value.

bool oa::Spinlock::tryLock()
No public source comment is attached to this declaration.

Returns

bool

The declared return value.

void oa::Spinlock::unlock()
No public source comment is attached to this declaration.

Returns

void

The declared return value.