18#include "pw_function/function.h"
19#include "pw_thread/attrs.h"
20#include "pw_thread/context.h"
21#include "pw_thread/id.h"
22#include "pw_thread/native_options.h"
23#include "pw_thread/options.h"
27#include "pw_thread_backend/thread_native.h"
31#ifdef _PW_THREAD_GENERIC_CREATION_UNSUPPORTED
33#define PW_THREAD_GENERIC_CREATION_IS_SUPPORTED 0
34#undef _PW_THREAD_GENERIC_CREATION_UNSUPPORTED
41#define PW_THREAD_GENERIC_CREATION_IS_SUPPORTED 1
86 using id = ::pw::thread::backend::NativeId;
120 template <const ThreadAttrs& kAttributes>
122 :
Thread(GetThreadOptions(context), std::move(entry)) {}
127 template <
size_t kStackSizeH
intBytes>
131 :
Thread(GetThreadOptions(context, attributes), std::move(entry)) {}
138 :
Thread(GetThreadOptions(context, attributes), std::move(entry)) {}
165#if PW_THREAD_JOINING_ENABLED
181 template <
typename...,
bool kJoiningEnabled =
false>
183 static_assert(kJoiningEnabled,
184 "The selected pw_thread_THREAD backend does not have join() "
185 "enabled (AKA PW_THREAD_JOINING_ENABLED = 1)");
214 backend::NativeThread native_type_;
225#include "pw_thread_backend/thread_inline.h"
native_handle_type native_handle()
::pw::thread::backend::NativeId id
Definition: thread.h:86
backend::NativeThreadHandle native_handle_type
Definition: thread.h:69
Thread & operator=(Thread &&other)
bool joinable() const
Definition: thread.h:163
void swap(Thread &other)
Exchanges the underlying handles of two thread objects.
Thread(const Options &options, Function< void()> &&entry)
fit::function_impl< function_internal::config::kInlineCallableSize, !function_internal::config::kEnableDynamicAllocation, FunctionType, PW_FUNCTION_DEFAULT_ALLOCATOR_TYPE > Function
Definition: function.h:74
Provides basic helpers for reading and writing UTF-8 encoded strings.
Definition: alignment.h:27