13#ifndef BOOST_FAIRNESS_PRIORITY_MUTEX_TATAS_HPP
14#define BOOST_FAIRNESS_PRIORITY_MUTEX_TATAS_HPP
48 template<
size_t N = 1>
52 using Thread_cnt_t = uint32_t;
57 priority_mutex() =
default;
60 priority_mutex(
const priority_mutex&) =
delete;
63 priority_mutex& operator=(
const priority_mutex&) =
delete;
66 priority_mutex(priority_mutex&&) =
delete;
69 priority_mutex& operator=(priority_mutex&&) =
delete;
72 ~priority_mutex() =
default;
116 internalMutex_.lock(priority);
118 ++waiters_[priority];
124 find_first_priority_() >= priority
127 --waiters_[priority];
131 internalMutex_.unlock();
136 internalMutex_.unlock();
138 detail::wait(waitingFlag_[priority], detail::wait_flag);
140 internalMutex_.lock(priority);
187 internalMutex_.lock();
191 p = find_first_priority_();
194 internalMutex_.unlock();
198 waitingFlag_.reset_(p);
200 internalMutex_.unlock();
254 internalMutex_.lock(priority);
257 find_first_priority_() < priority){
259 internalMutex_.unlock();
266 internalMutex_.unlock();
277 std::array<Thread_cnt_t, N> waiters_{};
Definition wait_pool.hpp:45
bool try_lock(Priority_t const priority=0)
Try to acquire the unique ownership of the priority_mutex with a designated priority....
Definition priority_mutex_tatas.hpp:253
The spinlock_priority_mutex is an advanced synchronization mechanism that enhances the traditional mu...
Definition spinlock_priority_mutex_cpl.hpp:31
#define BOOST_FAIRNESS_HARDWARE_DESTRUCTIVE_SIZE
Size to be aligned to avoid false sharing
Definition config.hpp:85
void wait(T &mem, K const expected) noexcept
Definition wait_ops.hpp:69
void notify_one(T &mem) noexcept
Definition wait_ops.hpp:103
Definition acquisition_modes.hpp:16
uint8_t Priority_t
Definition priority_t.hpp:17
Alias the type Priority_t. Priority_t is the type of priorities that are used by the priority_mutexes...
#define BOOST_FAIRNESS_MAXIMUM_PRIORITY
Priorities are indexes in an array, that means that if I define a priority_mutex<BOOST_FAIRNESS_MAXIM...
Definition priority_t.hpp:24
This file contains the implementation of the spinlock_priority_mutex based on a scalable list base al...
This file contains the implementation of the wait operations used by the mutexes.
This file contains the implementation of a wait pool.