7#include "unfair_mutex.hpp"
11namespace hi::inline
v1 {
90 if (owner.
load(std::memory_order::acquire) == thread_id) {
107 owner.
store(thread_id, std::memory_order::release);
145 if (owner.
load(std::memory_order::acquire) == thread_id) {
164 owner.
store(thread_id, std::memory_order::release);
168 void unlock() noexcept
181 owner.
store(0, std::memory_order::release);
#define hi_axiom(expression)
Specify an axiom; an expression that is true.
Definition assert.hpp:133
#define hilet
Invariant should be the default for variables.
Definition utility.hpp:23
DOXYGEN BUG.
Definition algorithm.hpp:15
thread_id current_thread_id() noexcept
Get the current thread id.
Definition thread.hpp:39
An unfair mutex This is a fast implementation of a mutex which does not fairly arbitrate between mult...
Definition unfair_mutex.hpp:33
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:81
An unfair recursive-mutex This is a fast implementation of a recursive-mutex which does not fairly ar...
Definition unfair_recursive_mutex.hpp:32
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:60
void lock() noexcept
Definition unfair_recursive_mutex.hpp:133
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:78