Generic attributes of a thread. ThreadAttrs
is used with a ThreadContext
to create threads.
ThreadAtts
provides three attributes: name, priority, stack size, and stack location. These attributes should be considered only as hints – the pw_thread backend may not support them.
Public Member Functions | |
constexpr | ThreadAttrs () |
Initializes attributes to their backend-defined defaults. | |
constexpr | ThreadAttrs (const ThreadAttrs &)=default |
Thread attributes can be copied to share properties between threads. | |
constexpr ThreadAttrs & | operator= (const ThreadAttrs &)=default |
constexpr const char * | name () const |
Name hint as a null-terminated string. Never null. | |
constexpr ThreadAttrs & | set_name (const char *name) |
constexpr ThreadAttrs & | set_name (std::nullptr_t)=delete |
constexpr ThreadPriority | priority () const |
constexpr ThreadAttrs & | set_priority (ThreadPriority priority) |
Sets a thread priority hint. | |
constexpr auto | native_stack () const |
constexpr auto | native_stack_pointer () const |
constexpr auto | native_stack_size () const |
constexpr size_t | stack_size_bytes () const |
Returns the size of the stack in bytes. | |
constexpr ThreadAttrs & | set_stack_size_bytes (size_t stack_size_bytes) |
template<size_t kStackSizeBytes> | |
constexpr ThreadAttrs & | set_stack (ThreadStack< kStackSizeBytes > &stack) |
constexpr ThreadAttrs & | clear_stack () |
Clears a previous call to set_stack . | |
constexpr bool | has_external_stack () const |