AUI Framework
develop
Cross-platform base for C++ UI apps
|
Synchronization primitive that is implemented with atomic values instead of doing syscalls. More...
#include <AUI/Thread/AMutex.h>
Public Member Functions | |
void | lock () |
bool | try_lock () noexcept |
Tries to acquire the mutex without blocking. | |
void | unlock () noexcept |
Synchronization primitive that is implemented with atomic values instead of doing syscalls.
In contrast to a regular mutex, threads will busy-wait (infinitely check for unlocked state) and waste CPU cycles instead of yielding the CPU to another thread with a syscall.
ASpinlockMutex may be faster than a regular mutex in some cases. Use benchmarks to compare.
|
inlinenodiscardnoexcept |
Tries to acquire the mutex without blocking.