19#include "pw_span/span.h"
20#include "pw_thread/priority.h"
21#include "pw_thread/stack.h"
38 stack_size_(thread::backend::kDefaultStackSizeBytes) {}
45 constexpr const char*
name()
const {
return name_; }
48 PW_DASSERT(
name !=
nullptr);
53 constexpr ThreadAttrs& set_name(std::nullptr_t) =
delete;
70 return internal::ThreadStackSpan(stack_, stack_size_);
90 return internal::NativeStackSizeBytes(stack_size_);
106 template <
size_t kStackSizeBytes>
116 stack_size_ = thread::backend::kDefaultStackSizeBytes;
123 return stack_ !=
nullptr;
130 internal::ThreadStackPointer stack_;
constexpr ThreadAttrs()
Initializes attributes to their backend-defined defaults.
Definition: attrs.h:34
constexpr bool has_external_stack() const
Definition: attrs.h:122
constexpr auto native_stack_size() const
Definition: attrs.h:82
constexpr size_t stack_size_bytes() const
Returns the size of the stack in bytes.
Definition: attrs.h:88
constexpr auto native_stack_pointer() const
Definition: attrs.h:76
constexpr ThreadAttrs & set_stack_size_bytes(size_t stack_size_bytes)
Definition: attrs.h:98
constexpr ThreadAttrs & clear_stack()
Clears a previous call to set_stack.
Definition: attrs.h:114
constexpr ThreadAttrs & set_priority(ThreadPriority priority)
Sets a thread priority hint.
Definition: attrs.h:58
constexpr ThreadAttrs(const ThreadAttrs &)=default
Thread attributes can be copied to share properties between threads.
constexpr const char * name() const
Name hint as a null-terminated string. Never null.
Definition: attrs.h:45
constexpr ThreadAttrs & set_stack(ThreadStack< kStackSizeBytes > &stack)
Definition: attrs.h:107
constexpr auto native_stack() const
Definition: attrs.h:68
constexpr native native_pointer()
Definition: stack.h:72
constexpr size_t native_size() const
Definition: stack.h:80
Provides basic helpers for reading and writing UTF-8 encoded strings.
Definition: alignment.h:27
thread::internal::Priority< thread::backend::PriorityType, thread::backend::kLowestPriority, thread::backend::kHighestPriority, thread::backend::kDefaultPriority > ThreadPriority
Definition: priority.h:37