Thread attributes. More...
#include <cmsis-plus/rtos/os.h>
Public Member Functions | |
Constructors & Destructor | |
constexpr | attributes () |
Construct a thread attributes object instance. | |
attributes (const attributes &)=default | |
attributes (attributes &&)=default | |
attributes & | operator= (const attributes &)=default |
attributes & | operator= (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::clock * | clock = nullptr |
Attribute with the address of the clock to be used for timeouts. | |
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.
pthread_attr_t
from <pthread.h> (IEEE Std 1003.1, 2013 Edition). Definition at line 797 of file os-thread.h.
|
constexpr |
Construct a thread attributes object instance.
Definition at line 2111 of file os-thread.h.
|
default |
|
default |
|
default |
Destruct the thread 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 615 of file os-decls.h.
bool os::rtos::thread::attributes::th_enable_assert_reuse = false |
Definition at line 871 of file os-thread.h.
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 869 of file os-thread.h.
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 845 of file os-thread.h.
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 858 of file os-thread.h.