15namespace hi {
inline namespace v1 {
95 if (owner.
load(std::memory_order::acquire) == thread_id) {
112 owner.
store(thread_id, std::memory_order::release);
150 if (owner.
load(std::memory_order::acquire) == thread_id) {
169 owner.
store(thread_id, std::memory_order::release);
173 void unlock() noexcept
186 owner.
store(0, std::memory_order::release);
Functions and types for accessing operating system threads.
Definition of the unfair_mutex.
#define hi_axiom(expression,...)
Specify an axiom; an expression that is true.
Definition assert.hpp:238
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
thread_id current_thread_id() noexcept
Get the current thread id.
Definition thread.hpp:44
DOXYGEN BUG.
Definition algorithm.hpp:13
geometry/margins.hpp
Definition cache.hpp:11
An unfair mutex This is a fast implementation of a mutex which does not fairly arbitrate between mult...
Definition unfair_mutex.hpp:36
bool try_lock() noexcept
When try_lock() is called from a thread that already owns the lock it will return false.
Definition unfair_mutex.hpp:84
An unfair recursive-mutex This is a fast implementation of a recursive-mutex which does not fairly ar...
Definition unfair_recursive_mutex.hpp:37
void lock() noexcept
Definition unfair_recursive_mutex.hpp:138
bool try_lock() noexcept
When try_lock() is called on a thread that already holds the lock true is returned.
Definition unfair_recursive_mutex.hpp:83
int recurse_lock_count() const noexcept
This function should be used in hi_axiom() to check if the lock is held by current thread.
Definition unfair_recursive_mutex.hpp:65