28 #ifndef CMSIS_PLUS_RTOS_OS_MUTEX_H_ 29 #define CMSIS_PLUS_RTOS_OS_MUTEX_H_ 33 #if defined(__cplusplus) 45 #pragma GCC diagnostic push 46 #pragma GCC diagnostic ignored "-Wpadded" 240 attributes (
const attributes&) =
default;
241 attributes (attributes&&) =
default;
243 operator= (
const attributes&) =
default;
245 operator= (attributes&&) =
default;
250 ~attributes () =
default;
329 attributes_recursive (
const attributes_recursive&) =
default;
330 attributes_recursive (attributes_recursive&&) =
default;
331 attributes_recursive&
332 operator= (
const attributes_recursive&) =
default;
333 attributes_recursive&
334 operator= (attributes_recursive&&) =
default;
339 ~attributes_recursive () =
default;
379 operator= (
const mutex&) =
delete;
381 operator= (
mutex&&) =
delete;
618 internal_init_ (
void);
627 internal_try_lock_ (
thread* th);
635 internal_unlock_ (
thread* th);
638 internal_mark_owner_dead_ (
void);
660 thread*
volatile owner_ =
nullptr;
662 #if !defined(OS_USE_RTOS_PORT_MUTEX) 664 clock* clock_ =
nullptr;
675 #if defined(OS_USE_RTOS_PORT_MUTEX) 676 friend class port::mutex;
677 os_mutex_port_data_t port_;
689 bool owner_dead_ =
false;
690 bool consistent_ =
true;
691 bool recoverable_ =
true;
780 #pragma GCC diagnostic pop result_t reset(void)
Reset the mutex.
type_t type(void)
Get the mutex type.
Default value. Differs from POSIX, which uses none.
static const attributes initializer_normal
Default normal mutex initialiser.
uint8_t protocol_t
Type of variables holding mutex protocols.
Priority ordered list of threads.
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.
uint8_t type_t
Type of variables holding mutex behaviours.
bool operator==(const mutex_recursive &rhs) const
Compare mutexes.
mutex(const attributes &attr=initializer_normal)
Construct a mutex object instance.
Base class for attributes.
uint8_t robustness_t
Type of variables holding mutex robustness.
uint16_t count_t
Type of variables holding mutex recursion counters.
static constexpr count_t max_count
Constant with the maximum value for the recursion counter.
robustness_t robustness(void)
Get the mutex robustness.
result_t unlock(void)
Unlock/release the mutex.
const char * name(void) const
Get object name.
Inherit priority from highest priority thread.
Base class for named system objects.
uint8_t priority_t
Type of variables holding thread priorities.
protocol_t protocol(void)
Get the mutex protocol.
bool operator==(const mutex &rhs) const
Compare mutexes.
POSIX compliant thread, using the default RTOS allocator.
port::clock::duration_t duration_t
Type of variables holding clock durations.
The core of a double linked list, pointers to next, previous.
thread * owner(void)
Get the thread that owns the mutex.
Maximum value, for validation purposes.
constexpr attributes()
Construct a mutex attributes object instance.
~mutex()
Destruct the mutex object instance.
~mutex_recursive()
Destruct the recursive mutex object instance.
static const attributes_recursive initializer_recursive
Default recursive mutex initialiser.
result_t consistent(void)
Mark mutex as consistent.
Recursive mutex attributes.
result_t try_lock(void)
Try to lock/acquire the mutex.
result_t lock(void)
Lock/acquire the mutex.
POSIX compliant recursive mutex.
uint32_t result_t
Type of values returned by RTOS functions.
constexpr attributes_recursive()
Construct a recursive mutex attributes object instance.
Recursive mutex behaviour.
Priority and scheduling not affected by mutex ownership.
Execute at the highest priority.
mutex_recursive(const attributes &attr=initializer_recursive)
Construct a recursive mutex object instance.