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;
79using unfair_mutex = unfair_mutex_impl<true>;
81using unfair_mutex = unfair_mutex_impl<false>;
The HikoGUI namespace.
Definition array_generic.hpp:21
The HikoGUI API version 1.
Definition array_generic.hpp:22
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