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
90 using id = ::pw::thread::backend::NativeId;
124 template <const ThreadAttrs& kAttributes>
126 :
Thread(GetThreadOptions(context), std::move(entry)) {}
131 template <
size_t kStackSizeH
intBytes>
135 :
Thread(GetThreadOptions(context, attributes), std::move(entry)) {}
142 :
Thread(GetThreadOptions(context, attributes), std::move(entry)) {}
169#if PW_THREAD_JOINING_ENABLED
185 template <
typename...,
bool kJoiningEnabled =
false>
187 static_assert(kJoiningEnabled,
188 "The selected pw_thread_THREAD backend does not have join() "
189 "enabled (AKA PW_THREAD_JOINING_ENABLED = 1)");
218 backend::NativeThread native_type_;
229#include "pw_thread_backend/thread_inline.h"
fit::function_impl< function_internal::config::kInlineCallableSize, !function_internal::config::kEnableDynamicAllocation, FunctionType, PW_FUNCTION_DEFAULT_ALLOCATOR_TYPE > Function
Definition: function.h:73
native_handle_type native_handle()
::pw::thread::backend::NativeId id
Definition: thread.h:90
backend::NativeThreadHandle native_handle_type
Definition: thread.h:73
Thread & operator=(Thread &&other)
bool joinable() const
Definition: thread.h:167
void swap(Thread &other)
Exchanges the underlying handles of two thread objects.
Thread(const Options &options, Function< void()> &&entry)
The Pigweed namespace.
Definition: alignment.h:27