µ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::thread::attributes Class Reference

Thread attributes. More...

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

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

Public Member Functions

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

Public Attributes

Public Member Variables
void * th_stack_address = nullptr
 Address of the user defined storage for the thread stack. More...
 
std::size_t th_stack_size_bytes = 0
 Size of the user defined storage for the thread stack, in bytes. More...
 
priority_t th_priority = priority::normal
 Thread initial priority. More...
 
Public Member Variables
rtos::clockclock = nullptr
 Attribute with the address of the clock to be used for timeouts. More...
 

Detailed Description

Thread attributes.

Allow to assign custom attributes (like stack address, stack size, priority) to the thread.

To simplify access, the member variables are public and do not require accessors or mutators.

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

Definition at line 770 of file os-thread.h.

Constructor & Destructor Documentation

◆ attributes() [1/3]

constexpr os::rtos::thread::attributes::attributes ( )

Construct a thread attributes object instance.

Parameters
None.

Definition at line 2062 of file os-thread.h.

◆ attributes() [2/3]

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

◆ attributes() [3/3]

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

◆ ~attributes()

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

Destruct the thread attributes object instance.

Member Function Documentation

◆ operator=() [1/2]

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

◆ operator=() [2/2]

attributes& os::rtos::thread::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.

◆ th_priority

priority_t os::rtos::thread::attributes::th_priority = priority::normal

Thread initial priority.

If 0, the default is thread::priority::normal.

A convenient and explicit variant to this attribute is to call thread::priority (priority_t) at the beginning of the thread function.

Definition at line 842 of file os-thread.h.

◆ th_stack_address

void* os::rtos::thread::attributes::th_stack_address = nullptr

Address of the user defined storage for the thread stack.

If nullptr, the default is to dynamically allocate the stack.

Definition at line 818 of file os-thread.h.

◆ th_stack_size_bytes

std::size_t os::rtos::thread::attributes::th_stack_size_bytes = 0

Size of the user defined storage for the thread stack, in bytes.

If 0, the default is thread::stack::default_size().

A convenient and explicit variant to this attribute is to call thread::stack::default_size (std::size_t) just before creating the thread. However mind setting this from different threads at the same time.

Definition at line 831 of file os-thread.h.


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