15#include <shared_mutex>
19namespace aui::detail {
52 MutexExtras::lock_shared();
79 return mState.exchange(LOCKED, std::memory_order_acquire) == UNLOCKED;
82 void unlock() noexcept {
83 mState.store(UNLOCKED, std::memory_order_release);
87 enum State { UNLOCKED, LOCKED };
88 std::atomic<State> mState = UNLOCKED;
100 void try_shared_lock() {}
101 void shared_unlock() {}
Implements mutex interface but does nothing, useful for mocking a mutex.
Definition: AMutex.h:94
Synchronization primitive that is implemented with atomic values instead of doing syscalls.
Definition: AMutex.h:65
bool try_lock() noexcept
Tries to acquire the mutex without blocking.
Definition: AMutex.h:78
Basic syscall-based synchronization primitive.
Definition: AMutex.h:33
Like AMutex but can handle multiple locks for one thread (recursive).
Definition: AMutex.h:42
Like AMutex but has shared lock type (in addition to basic lock which is unique locking) implementing...
Definition: AMutex.h:49