13#include "../macros.hpp"
16namespace hi {
inline namespace v1 {
96 if (owner.
load(std::memory_order::acquire) == thread_id) {
106 hi_axiom(count == 0);
108 hi_axiom(owner == 0);
113 owner.
store(thread_id, std::memory_order::release);
151 if (owner.
load(std::memory_order::acquire) == thread_id) {
153 hi_axiom(count != 0);
163 hi_axiom(count == 0);
165 hi_axiom(owner == 0);
170 owner.
store(thread_id, std::memory_order::release);
187 owner.
store(0, std::memory_order::release);
Functions and types for accessing operating system threads.
Definition of the unfair_mutex.
thread_id current_thread_id() noexcept
Get the current thread id.
DOXYGEN BUG.
Definition algorithm.hpp:16
geometry/margins.hpp
Definition lookahead_iterator.hpp:5
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:377
An unfair mutex This is a fast implementation of a mutex which does not fairly arbitrate between mult...
Definition unfair_mutex_intf.hpp:38
bool try_lock() noexcept
When try_lock() is called from a thread that already owns the lock it will return false.
Definition unfair_mutex_impl.hpp:213
An unfair recursive-mutex This is a fast implementation of a recursive-mutex which does not fairly ar...
Definition unfair_recursive_mutex.hpp:38
void lock() noexcept
Definition unfair_recursive_mutex.hpp:139
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:84
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:66