µOS++ IIIe Reference 7.0.0
The third edition of µOS++, a POSIX inspired open source framework, written in C++
Loading...
Searching...
No Matches

C++ API mutexes definitions. More...

Classes

class  os::rtos::mutex::attributes
 Mutex attributes. More...
 
class  os::rtos::mutex::attributes_recursive
 Recursive mutex attributes. More...
 
class  os::rtos::mutex
 POSIX compliant mutex. More...
 
class  os::rtos::mutex_recursive
 POSIX compliant recursive mutex. More...
 
class  os::rtos::mutex::protocol
 Mutex protocols. More...
 
class  os::rtos::mutex::robustness
 Mutex robustness. More...
 
class  os::rtos::mutex::type
 Mutex types. More...
 

Typedefs

using os::rtos::mutex::count_t = uint16_t
 Type of variables holding mutex recursion counters.
 
using os::rtos::mutex::protocol_t = uint8_t
 Type of variables holding mutex protocols.
 
using os::rtos::mutex::robustness_t = uint8_t
 Type of variables holding mutex robustness.
 
using os::rtos::mutex::type_t = uint8_t
 Type of variables holding mutex behaviours.
 

Variables

static const attributes os::rtos::mutex::initializer_normal
 Default normal mutex initialiser.
 
static const attributes_recursive os::rtos::mutex::initializer_recursive
 Default recursive mutex initialiser.
 
static constexpr count_t os::rtos::mutex::max_count = 0xFFFF
 Constant with the maximum value for the recursion counter.
 

Detailed Description

C++ API mutexes definitions.

Examples
int
os_main (int argc, char* argv[])
{
{
mutex mx1;
mx1.lock ();
mx1.unlock ();
mx1.try_lock ();
mx1.unlock ();
mx1.timed_lock (10);
mx1.unlock ();
mx1.name ();
mx1.type ();
mx1.protocol ();
mx1.robustness ();
mx1.owner ();
thread::priority_t prio = mx1.prio_ceiling ();
mx1.prio_ceiling (prio);
mx1.reset ();
}
{
mutex mx2
{ "mx2" };
mx2.lock ();
mx2.unlock ();
}
{
mutex mx3
{ "mx2", mutex::initializer_recursive };
mx3.lock ();
mx3.unlock ();
}
}
int os_main(int argc, char *argv[])
Application entry point, running on the main thread context.

Typedef Documentation

◆ count_t

using os::rtos::mutex::count_t = uint16_t

Type of variables holding mutex recursion counters.

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

◆ protocol_t

using os::rtos::mutex::protocol_t = uint8_t

Type of variables holding mutex protocols.

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

◆ robustness_t

Type of variables holding mutex robustness.

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

◆ type_t

using os::rtos::mutex::type_t = uint8_t

Type of variables holding mutex behaviours.

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

Variable Documentation

◆ initializer_normal

const mutex::attributes os::rtos::mutex::initializer_normal
static

Default normal mutex initialiser.

This variable is used by the normal mutex default constructor.

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

◆ initializer_recursive

const mutex::attributes_recursive os::rtos::mutex::initializer_recursive
static

Default recursive mutex initialiser.

This variable is used by the recursive mutex default constructor.

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

◆ max_count

constexpr count_t os::rtos::mutex::max_count = 0xFFFF
staticconstexpr

Constant with the maximum value for the recursion counter.

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