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 | |
| 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. | |
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 799 of file os-thread.h.
|
constexpr |
|
default |
|
default |
|
default |
|
default |
|
default |
|
inherited |
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 612 of file os-decls.h.
Referenced by os::rtos::event_flags::event_flags(), os::rtos::mutex::mutex(), and os::rtos::timer::timer().
| bool os::rtos::thread::attributes::th_enable_assert_reuse = false |
Definition at line 875 of file os-thread.h.
Referenced by os::rtos::thread::thread().
| priority_t os::rtos::thread::attributes::th_priority = priority::normal |
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 873 of file os-thread.h.
Referenced by osThreadCreate().
| void* os::rtos::thread::attributes::th_stack_address = nullptr |
If nullptr, the default is to dynamically allocate the stack.
Definition at line 847 of file os-thread.h.
Referenced by os::rtos::thread::thread(), os::rtos::thread_allocated< Allocator >::thread_allocated(), and osThreadCreate().
| std::size_t os::rtos::thread::attributes::th_stack_size_bytes = 0 |
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 861 of file os-thread.h.
Referenced by os::rtos::thread::thread(), os::rtos::thread_allocated< Allocator >::thread_allocated(), main(), and osThreadCreate().