carb::tasking::SpinMutex

Defined in carb/tasking/TaskingUtils.h

struct carb::tasking::SpinMutex

This atomic spin lock conforms to C++ Named Requirements of Lockable which makes it compatiable with std::lock_guard.

Public Functions

constexpr SpinMutex() = default

Constructs the SpinMutex.

inline void lock()

Spins until the lock is acquired.

See § 30.4.1.2.1 in the C++11 standard.

inline bool try_lock()

Attempts to acquire the lock, on try, returns true if the lock was acquired.

inline void unlock()

Unlocks, wait-free.

See § 30.4.1.2.1 in the C++11 standard.