11#include "../utility/utility.hpp"
12#include "../macros.hpp"
16hi_export_module(hikogui.concurrency.unfair_mutex : intf);
18hi_export
namespace hi {
inline namespace v1 {
37template<
bool UseDeadLockDetector>
48 bool is_locked()
const noexcept;
61 void unlock()
noexcept;
70 std::atomic_unsigned_lock_free semaphore = 0;
71 using semaphore_value_type =
typename decltype(semaphore)::value_type;
73 bool holds_invariant()
const noexcept;
75 void lock_contended(semaphore_value_type
expected)
noexcept;
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
The HikoGUI namespace.
Definition recursive_iterator.hpp:15
constexpr Out narrow_cast(In const &rhs) noexcept
Cast numeric values without loss of precision.
Definition cast.hpp:378
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:216