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;
59 [[nodiscard]]
bool try_lock()
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;
The HikoGUI namespace.
Definition array_generic.hpp:20
DOXYGEN BUG.
Definition algorithm_misc.hpp:20
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