fairness  v1.0.0
A collection of advanced syncronization mechanisms.
Loading...
Searching...
No Matches
boost::fairness Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  control_block_64b_simple_t
 
class  priority_mutex
 The priority_mutex is an advanced synchronization mechanism that enhances the traditional mutex by introducing a priority-based approach.
It serves to protect shared data from simultaneous access by multiple threads and provides exclusive, non-recursive ownership semantics: More...
 
class  recursive_priority_mutex
 The recursive_priority_mutex is an advanced synchronization mechanism that enhances the traditional mutex by introducing a priority-based approach.
The recursive_priority_mutex can be used to protect shared data from being simultaneously accessed by multiple threads.
recursive_priority_mutex offers exclusive, recursive ownership semantics: More...
 
class  shared_lock
 The class shared_lock is a general-purpose shared mutex ownership wrapper allowing deferred locking, timed locking and transfer of lock ownership. Locking a shared_lock locks the associated shared mutex in shared mode (to lock it in exclusive mode, std::unique_lock can be used).
The shared_lock class is movable, but not copyable – it meets the requirements of MoveConstructible and MoveAssignable but not of CopyConstructible or CopyAssignable.
shared_lock meets the Lockable requirements. If Lockable meets the SharedTimedLockable requirements, shared_lock also meets TimedLockable requirements.
In order to wait in a shared mutex in shared ownership mode, std::condition_variable_any can be used (std::condition_variable requires std::unique_lock and so can only wait in unique ownership mode). More...
 
class  shared_priority_mutex
 The shared_priority_mutex is an advanced synchronization mechanism that enhances the traditional shared_mutex by introducing a priority-based approach.
The shared_priority_mutex class is a synchronization primitive that can be used to protect shared data from being simultaneously accessed by multiple threads. In contrast to other mutex types which facilitate exclusive access, a shared_mutex has two levels of access: More...
 
class  slim_priority_mutex< N, Range<(1<=N &&N<=BOOST_FAIRNESS_SPM64B_SUPPORTED_PRIORITIES)> >
 The slim_priority_mutex is an advanced synchronization mechanism that enhances the traditional mutex by introducing a priority-based approach.
The slim_priority_mutex can be used to protect shared data from being simultaneously accessed by multiple threads.
slim_priority_mutex offers exclusive, non-recursive ownership semantics: More...
 
class  spinlock_priority_mutex
 The spinlock_priority_mutex is an advanced synchronization mechanism that enhances the traditional mutex by introducing a priority-based approach. More...
 
class  unique_lock
 The class unique_lock is a general-purpose mutex ownership wrapper allowing deferred locking, time-constrained attempts at locking, recursive locking, transfer of lock ownership, and use with condition variables.
The class unique_lock is movable, but not copyable – it meets the requirements of MoveConstructible and MoveAssignable but not of CopyConstructible or CopyAssignable.
The class unique_lock meets the BasicLockable requirements. If Lockable meets the Lockable requirements, unique_lock also meets the Lockable requirements (ex.: can be used in boost::fairness::lock); if Lockable meets the TimedLockable requirements, unique_lock also meets the TimedLockable requirements. More...
 

Typedefs

using Priority_t = uint8_t
 

Functions

bool is_valid_priority (Priority_t const p)
 allows you to verify that an input priority is valid. Has to be in the range [BOOST_FAIRNESS_MINIMUM_PRIORITY, BOOST_FAIRNESS_MAXIMUM_PRIORITY).
 
template<typename Lockable >
void swap (shared_lock< Lockable > &lhs, shared_lock< Lockable > &rhs) noexcept
 
template<typename Lockable >
void swap (unique_lock< Lockable > &lhs, unique_lock< Lockable > &rhs) noexcept
 

Typedef Documentation

◆ Priority_t

using boost::fairness::Priority_t = typedef uint8_t

Function Documentation

◆ is_valid_priority()

bool boost::fairness::is_valid_priority ( Priority_t const  p)
inline

allows you to verify that an input priority is valid. Has to be in the range [BOOST_FAIRNESS_MINIMUM_PRIORITY, BOOST_FAIRNESS_MAXIMUM_PRIORITY).

Parameters
p: The priority to verify.
Returns
true : if is valid.
false : if isn't valid.

◆ swap() [1/2]

template<typename Lockable >
void boost::fairness::swap ( shared_lock< Lockable > &  lhs,
shared_lock< Lockable > &  rhs 
)
inlinenoexcept

◆ swap() [2/2]

template<typename Lockable >
void boost::fairness::swap ( unique_lock< Lockable > &  lhs,
unique_lock< Lockable > &  rhs 
)
inlinenoexcept
Template Parameters
Lockable
Parameters
lhs
rhs