zpp
Zephyr C++20 Framework
|
The class thread repecents a single Zephyr thread. More...
#include <thread.hpp>
Public Member Functions | |
constexpr | thread () noexcept |
Creates a object which doesn't represent a Zephyr thread. More... | |
constexpr | thread (thread_id tid) noexcept |
Creates a object which represents Zephyr thread with tid. More... | |
template<typename T_Heap , typename T_Callback , typename... T_CallbackArgs, std::enable_if_t< std::is_nothrow_invocable_v< T_Callback, T_CallbackArgs... >, bool > = true> | |
constexpr | thread (thread_data &td, thread_stack &&tstack, const thread_attr &attr, T_Heap *heap, T_Callback &&f, T_CallbackArgs &&... args) noexcept |
Creates a object which represents a new Zephyr thread. More... | |
template<typename T_Callback , typename T_CallbackArg , std::enable_if_t< std::is_nothrow_invocable_v< T_Callback, T_CallbackArg >, bool > = true> | |
constexpr | thread (thread_data &td, thread_stack &&tstack, const thread_attr &attr, T_Callback f, T_CallbackArg arg) noexcept |
Creates a object which represents a new Zephyr thread. More... | |
template<typename T_Callback , std::enable_if_t< std::is_nothrow_invocable_v< T_Callback >, bool > = true> | |
constexpr | thread (thread_data &td, thread_stack &&tstack, const thread_attr &attr, T_Callback f) noexcept |
Creates a object which represents a new Zephyr thread. More... | |
constexpr | thread (thread &&other) noexcept |
Move constructor. More... | |
constexpr thread & | operator= (thread &&other) noexcept |
Move assignment operator. More... | |
~thread () noexcept | |
Destructor, will abort the thread. More... | |
constexpr | operator bool () const noexcept |
check if this object manages a thread More... | |
constexpr void | detach () noexcept |
Detach this object from the thread. More... | |
auto | wakeup () noexcept |
wakeup the thread this object mamages. More... | |
auto | start () noexcept |
start the thread this object mamages. More... | |
auto | abort () noexcept |
abort the thread this object mamages. More... | |
auto | resume () noexcept |
resume the thread this object mamages. More... | |
auto | join () noexcept |
join the thread this object mamages. More... | |
auto | suspend () noexcept |
suspend the thread this object mamages. More... | |
auto | priority () noexcept |
Get priority of the thread this object mamages. More... | |
auto | set_priority (thread_prio prio) const noexcept |
Set priority of the thread this object mamages. More... | |
auto | set_name (const char *name) noexcept |
Set name of the thread this object mamages. More... | |
auto | name () const noexcept |
Get name of the thread this object mamages. More... | |
thread (const thread &)=delete | |
thread & | operator= (const thread &)=delete |
The class thread repecents a single Zephyr thread.
Definition at line 147 of file thread.hpp.
|
inlineconstexprnoexcept |
Creates a object which doesn't represent a Zephyr thread.
Definition at line 199 of file thread.hpp.
|
inlineexplicitconstexprnoexcept |
Creates a object which represents Zephyr thread with tid.
tid | The ID to manage |
Definition at line 208 of file thread.hpp.
|
inlineconstexprnoexcept |
Creates a object which represents a new Zephyr thread.
tcb | The TCB to use |
attr | The creation attributes to use |
f | The thread entry point |
args | The arguments to pass to f |
Definition at line 224 of file thread.hpp.
References zpp::decay_copy(), and zpp::base_heap< T_Heap >::try_allocate().
|
inlineconstexprnoexcept |
Creates a object which represents a new Zephyr thread.
tcb | The TCB to use |
attr | The creation attributes to use |
f | The thread entry point |
args | The arguments to pass to f |
Definition at line 284 of file thread.hpp.
|
inlineconstexprnoexcept |
Creates a object which represents a new Zephyr thread.
tcb | The TCB to use |
attr | The creation attributes to use |
f | The thread entry point |
args | The arguments to pass to f |
Definition at line 334 of file thread.hpp.
|
inlineconstexprnoexcept |
Move constructor.
other | the thread to move to this thread object, after the move other will not manage the thread anymore |
Definition at line 372 of file thread.hpp.
References zpp::thread_id::any().
|
inlinenoexcept |
Destructor, will abort the thread.
Definition at line 395 of file thread.hpp.
|
delete |
|
inlinenoexcept |
abort the thread this object mamages.
Definition at line 452 of file thread.hpp.
References zpp::thread_id::any(), zpp::result< T_Ok, T_Error >::assign_value(), and zpp::k_inval.
|
inlineconstexprnoexcept |
Detach this object from the thread.
Definition at line 414 of file thread.hpp.
References zpp::thread_id::any().
|
inlinenoexcept |
join the thread this object mamages.
Definition at line 483 of file thread.hpp.
References zpp::result< T_Ok, T_Error >::assign_error(), zpp::result< T_Ok, T_Error >::assign_value(), zpp::k_inval, and zpp::to_error_code().
Referenced by ZTEST().
|
inlinenoexcept |
Get name of the thread this object mamages.
Definition at line 573 of file thread.hpp.
References zpp::result< T_Ok, T_Error >::assign_error(), zpp::result< T_Ok, T_Error >::assign_value(), zpp::k_inval, and zpp::k_notsup.
|
inlineexplicitconstexprnoexcept |
check if this object manages a thread
Definition at line 407 of file thread.hpp.
Move assignment operator.
other | the thread to move to this thread object, after the move other will not manage the thread anymore |
Definition at line 384 of file thread.hpp.
References zpp::thread_id::any().
|
inlinenoexcept |
Get priority of the thread this object mamages.
Definition at line 519 of file thread.hpp.
References zpp::k_inval.
|
inlinenoexcept |
resume the thread this object mamages.
Definition at line 468 of file thread.hpp.
References zpp::result< T_Ok, T_Error >::assign_value(), and zpp::k_inval.
|
inlinenoexcept |
Set name of the thread this object mamages.
name | The new thread name |
Definition at line 552 of file thread.hpp.
References zpp::result< T_Ok, T_Error >::assign_error(), zpp::result< T_Ok, T_Error >::assign_value(), zpp::k_inval, and zpp::to_error_code().
|
inlinenoexcept |
Set priority of the thread this object mamages.
prio | The new thread priority |
Definition at line 535 of file thread.hpp.
References zpp::result< T_Ok, T_Error >::assign_value(), and zpp::k_inval.
|
inlinenoexcept |
start the thread this object mamages.
Definition at line 437 of file thread.hpp.
References zpp::result< T_Ok, T_Error >::assign_value(), and zpp::k_inval.
|
inlinenoexcept |
suspend the thread this object mamages.
Definition at line 502 of file thread.hpp.
References zpp::result< T_Ok, T_Error >::assign_value(), and zpp::k_inval.
|
inlinenoexcept |
wakeup the thread this object mamages.
Definition at line 422 of file thread.hpp.
References zpp::result< T_Ok, T_Error >::assign_value(), and zpp::k_inval.