muu::spin_mutex class

A mutex that acquires locks by spin-waiting.

Constructors, destructors, conversion operators

spin_mutex() noexcept
Default constructor.

Public functions

void lock() noexcept
Acquires a lock on the mutex.
auto try_lock() -> bool noexcept
Tries to acquire a lock on the mutex.
void unlock() noexcept
Releases the held lock on the mutex.

Function documentation

bool muu::spin_mutex::try_lock() noexcept

Tries to acquire a lock on the mutex.

Returns true if the lock was acquired.