µOS++ IIIe Reference  v6.3.15
“Perfekt ist nicht gut genug”
The third edition of µOS++, a POSIX inspired open source system, written in C++.
os::rtos::mutex::attributes Class Reference

Mutex attributes. More...

#include <cmsis-plus/rtos/os.h>

Inherits os::rtos::internal::attributes_clocked.

Inherited by os::rtos::mutex::attributes_recursive.

Public Member Functions

Constructors & Destructor
constexpr attributes ()
 Construct a mutex attributes object instance. More...
 
 attributes (const attributes &)=default
 
 attributes (attributes &&)=default
 
attributesoperator= (const attributes &)=default
 
attributesoperator= (attributes &&)=default
 
 ~attributes ()=default
 Destruct the mutex attributes object instance. More...
 

Public Attributes

Public Member Variables
thread::priority_t mx_priority_ceiling = thread::priority::highest
 Attribute with the mutex priority ceiling. More...
 
protocol_t mx_protocol = protocol::default_
 Attribute with the mutex protocol. More...
 
robustness_t mx_robustness = robustness::stalled
 Attribute with the mutex robustness. More...
 
type_t mx_type = type::default_
 Attribute with the mutex type. More...
 
count_t mx_max_count = max_count
 Attribute with the mutex maximum recursive count. More...
 
Public Member Variables
rtos::clockclock = nullptr
 Attribute with the address of the clock to be used for timeouts. More...
 

Detailed Description

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.

POSIX compatibility
Inspired by pthread_mutexattr_t from <pthread.h> (IEEE Std 1003.1, 2013 Edition).

Definition at line 207 of file os-mutex.h.

Constructor & Destructor Documentation

◆ attributes() [1/3]

constexpr os::rtos::mutex::attributes::attributes ( )

Construct a mutex attributes object instance.

Parameters
None.

Definition at line 797 of file os-mutex.h.

◆ attributes() [2/3]

os::rtos::mutex::attributes::attributes ( const attributes )
default

◆ attributes() [3/3]

os::rtos::mutex::attributes::attributes ( attributes &&  )
default

◆ ~attributes()

os::rtos::mutex::attributes::~attributes ( )
default

Destruct the mutex attributes object instance.

Member Function Documentation

◆ operator=() [1/2]

attributes& os::rtos::mutex::attributes::operator= ( const attributes )
default

◆ operator=() [2/2]

attributes& os::rtos::mutex::attributes::operator= ( attributes &&  )
default

Member Data Documentation

◆ clock

rtos::clock* os::rtos::internal::attributes_clocked::clock = nullptr
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 615 of file os-decls.h.

◆ mx_max_count

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 288 of file os-mutex.h.

◆ mx_priority_ceiling

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.

POSIX compatibility
Inspired by pthread_mutexattr_setprioceiling() from <pthread.h> (IEEE Std 1003.1, 2013 Edition).

Definition at line 268 of file os-mutex.h.

◆ mx_protocol

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.

See also
mutex::protocol
POSIX compatibility
Inspired by pthread_mutexattr_setprotocol() from <pthread.h> (IEEE Std 1003.1, 2013 Edition).
Differences from the standard:

Definition at line 273 of file os-mutex.h.

◆ mx_robustness

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.

See also
mutex::robustness
POSIX compatibility
Inspired by pthread_mutexattr_setrobust() from <pthread.h> (IEEE Std 1003.1, 2013 Edition).

Definition at line 278 of file os-mutex.h.

◆ mx_type

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_.

See also
mutex::type
POSIX compatibility
Inspired by pthread_mutexattr_settype() from <pthread.h> (IEEE Std 1003.1, 2013 Edition).

Definition at line 283 of file os-mutex.h.


The documentation for this class was generated from the following files: