13#ifndef CMSIS_PLUS_RTOS_OS_MUTEX_H_
14#define CMSIS_PLUS_RTOS_OS_MUTEX_H_
18#if defined(__cplusplus)
26#pragma GCC diagnostic push
28#pragma clang diagnostic ignored "-Wc++98-compat"
29#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
40#pragma GCC diagnostic push
42#pragma clang diagnostic ignored "-Wpadded"
43#elif defined(__GNUC__)
44#pragma GCC diagnostic ignored "-Wpadded"
378 operator= (
const mutex&) =
delete;
380 operator= (
mutex&&) =
delete;
617 internal_init_ (
void);
625 internal_try_lock_ (
thread* th);
633 internal_unlock_ (
thread* th);
636 internal_mark_owner_dead_ (
void);
658 thread*
volatile owner_ =
nullptr;
660#if !defined(OS_USE_RTOS_PORT_MUTEX)
662 clock* clock_ =
nullptr;
673#if defined(OS_USE_RTOS_PORT_MUTEX)
674 friend class port::mutex;
675 os_mutex_port_data_t port_;
687 bool owner_dead_ =
false;
688 bool consistent_ =
true;
689 bool recoverable_ =
true;
778#pragma GCC diagnostic pop
903#pragma GCC diagnostic pop
Base class for attributes.
Base class for named system objects.
const char * name(void) const
Get object name.
Priority ordered list of threads.
Recursive mutex attributes.
attributes_recursive & operator=(const attributes_recursive &)=default
attributes_recursive(const attributes_recursive &)=default
attributes_recursive(attributes_recursive &&)=default
~attributes_recursive()=default
Destruct the recursive mutex attributes object instance.
constexpr attributes_recursive()
Construct a recursive mutex attributes object instance.
count_t mx_max_count
Attribute with the mutex maximum recursive count.
constexpr attributes()
Construct a mutex attributes object instance.
type_t mx_type
Attribute with the mutex type.
robustness_t mx_robustness
Attribute with the mutex robustness.
~attributes()=default
Destruct the mutex attributes object instance.
thread::priority_t mx_priority_ceiling
Attribute with the mutex priority ceiling.
attributes & operator=(const attributes &)=default
protocol_t mx_protocol
Attribute with the mutex protocol.
attributes(attributes &&)=default
attributes(const attributes &)=default
POSIX compliant recursive mutex.
mutex_recursive(const attributes &attr=initializer_recursive)
Construct a recursive mutex object instance.
bool operator==(const mutex_recursive &rhs) const
Compare mutexes.
~mutex_recursive()
Destruct the recursive mutex object instance.
result_t reset(void)
Reset the mutex.
result_t lock(void)
Lock/acquire the mutex.
thread::priority_t prio_ceiling(void) const
Get the priority ceiling of a mutex.
result_t timed_lock(clock::duration_t timeout)
Timed attempt to lock/acquire the mutex.
result_t try_lock(void)
Try to lock/acquire the mutex.
bool operator==(const mutex &rhs) const
Compare mutexes.
~mutex()
Destruct the mutex object instance.
result_t consistent(void)
Mark mutex as consistent.
thread * owner(void)
Get the thread that owns the mutex.
result_t unlock(void)
Unlock/release the mutex.
POSIX compliant thread, using the default RTOS allocator.
The core of a double linked list, pointers to next, previous.
port::clock::duration_t duration_t
Type of variables holding clock durations.
uint8_t type_t
Type of variables holding mutex behaviours.
uint16_t count_t
Type of variables holding mutex recursion counters.
static const attributes_recursive initializer_recursive
Default recursive mutex initialiser.
uint8_t protocol_t
Type of variables holding mutex protocols.
uint8_t robustness_t
Type of variables holding mutex robustness.
static constexpr count_t max_count
Constant with the maximum value for the recursion counter.
static const attributes initializer_normal
Default normal mutex initialiser.
uint8_t priority_t
Type of variables holding thread priorities.
uint32_t result_t
Type of values returned by RTOS functions.
@ max_
Maximum value, for validation purposes.
@ default_
Default value. Differs from POSIX, which uses none.
@ none
Priority and scheduling not affected by mutex ownership.
@ inherit
Inherit priority from highest priority thread.
@ protect
Execute at the highest priority.
@ max_
Maximum value, for validation purposes.
@ stalled
Normal robustness.
@ robust
Enhanced robustness at thread termination.
@ max_
Maximum value, for validation purposes.
@ normal
Normal mutex behaviour.
@ errorcheck
Check mutex behaviour.
@ recursive
Recursive mutex behaviour.