Mutex attributes. More...
#include <cmsis-plus/rtos/os.h>
Public Member Functions | |
Constructors & Destructor | |
constexpr | attributes () |
Construct a mutex attributes object instance. | |
attributes (const attributes &)=default | |
attributes (attributes &&)=default | |
attributes & | operator= (const attributes &)=default |
attributes & | operator= (attributes &&)=default |
~attributes ()=default | |
Destruct the mutex attributes object instance. | |
Public Attributes | |
Public Member Variables | |
thread::priority_t | mx_priority_ceiling = thread::priority::highest |
Attribute with the mutex priority ceiling. | |
protocol_t | mx_protocol = protocol::default_ |
Attribute with the mutex protocol. | |
robustness_t | mx_robustness = robustness::stalled |
Attribute with the mutex robustness. | |
type_t | mx_type = type::default_ |
Attribute with the mutex type. | |
count_t | mx_max_count = max_count |
Attribute with the mutex maximum recursive count. | |
Public Member Variables | |
rtos::clock * | clock = nullptr |
Attribute with the address of the clock to be used for timeouts. | |
Mutex attributes.
Allow to assign a name and custom attributes (like priority ceiling, robustness, etc) to the mutex.
To simplify access, the member variables are public and do not require accessors or mutators.
If the attributes are modified after the mutex creation, the mutex attributes shall not be affected.
pthread_mutexattr_t
from <pthread.h>
(IEEE Std 1003.1, 2013 Edition). Definition at line 218 of file os-mutex.h.
|
constexpr |
Construct a mutex attributes object instance.
Definition at line 807 of file os-mutex.h.
|
default |
|
default |
|
default |
Destruct the mutex attributes object instance.
|
default |
|
default |
|
inherited |
Attribute with the address of the clock to be used for timeouts.
It may be one of os::rtos::sysclock
, os::rtos::rtclock
, or any other user object derived from class os::rtos::clock
.
If nullptr
, the default clock is os::rtos::sysclock
.
Definition at line 629 of file os-decls.h.
thread::priority_t os::rtos::mutex::attributes::mx_max_count = max_count |
Attribute with the mutex maximum recursive count.
The mx_max_count attribute defines the upper limit of recursion for a recursive mutex. Further attempts to lock the mutex will result in EAGAIN
.
Definition at line 299 of file os-mutex.h.
thread::priority_t os::rtos::mutex::attributes::mx_priority_ceiling = thread::priority::highest |
Attribute with the mutex priority ceiling.
The mx_priority_ceiling attribute defines the priority ceiling of initialised mutexes, which is the minimum priority level at which the critical section guarded by the mutex is executed. In order to avoid priority inversion, the priority ceiling of the mutex shall be set to a priority higher than or equal to the highest priority of all the threads that may lock that mutex. The values of mx_priority_ceiling are within the maximum range of priorities defined under the SCHED_FIFO scheduling policy.
pthread_mutexattr_setprioceiling()
from <pthread.h>
(IEEE Std 1003.1, 2013 Edition). Definition at line 279 of file os-mutex.h.
mutex::protocol_t os::rtos::mutex::attributes::mx_protocol = protocol::default_ |
Attribute with the mutex protocol.
The default value of this attribute shall be mutex::protocol::inherit
.
pthread_mutexattr_setprotocol()
from <pthread.h>
(IEEE Std 1003.1, 2013 Edition). mutex::protocol::none
. Definition at line 284 of file os-mutex.h.
mutex::robustness_t os::rtos::mutex::attributes::mx_robustness = robustness::stalled |
Attribute with the mutex robustness.
The default value of this attribute shall be mutex::robustness::stalled
.
pthread_mutexattr_setrobust()
from <pthread.h>
(IEEE Std 1003.1, 2013 Edition). Definition at line 289 of file os-mutex.h.
mutex::type_t os::rtos::mutex::attributes::mx_type = type::default_ |
Attribute with the mutex type.
The default value of this attribute shall be mutex::type::default_
.
pthread_mutexattr_settype()
from <pthread.h>
(IEEE Std 1003.1, 2013 Edition). Definition at line 294 of file os-mutex.h.