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

Thread attributes. More...

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

+ Inheritance diagram for os::rtos::thread::attributes:

Public Member Functions

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

Public Attributes

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

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.

If the attributes are modified after the thread creation, the thread attributes shall not be affected.

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

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

Constructor & Destructor Documentation

◆ attributes() [1/3]

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

Construct a thread attributes object instance.

Parameters
None.

Definition at line 2103 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= ( attributes &&  )
default

◆ operator=() [2/2]

attributes & os::rtos::thread::attributes::operator= ( const 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 629 of file os-decls.h.

◆ th_enable_assert_reuse

bool os::rtos::thread::attributes::th_enable_assert_reuse = false

Definition at line 864 of file os-thread.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 862 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 838 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 851 of file os-thread.h.


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