28#ifndef CMSIS_PLUS_RTOS_OS_MUTEX_H_
29#define CMSIS_PLUS_RTOS_OS_MUTEX_H_
33#if defined(__cplusplus)
41#pragma GCC diagnostic push
44#pragma clang diagnostic ignored "-Wc++98-compat"
45#pragma clang diagnostic ignored "-Wdocumentation-unknown-command"
56#pragma GCC diagnostic push
57#pragma GCC diagnostic ignored "-Wpadded"
390 operator= (
const mutex&) =
delete;
392 operator= (
mutex&&) =
delete;
629 internal_init_ (
void);
637 internal_try_lock_ (
thread* th);
645 internal_unlock_ (
thread* th);
648 internal_mark_owner_dead_ (
void);
670 thread*
volatile owner_ =
nullptr;
672#if !defined(OS_USE_RTOS_PORT_MUTEX)
674 clock* clock_ =
nullptr;
685#if defined(OS_USE_RTOS_PORT_MUTEX)
686 friend class port::mutex;
687 os_mutex_port_data_t port_;
699 bool owner_dead_ =
false;
700 bool consistent_ =
true;
701 bool recoverable_ =
true;
790#pragma GCC diagnostic pop
921#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.