7 #ifndef ZPP_INCLUDE_ZPP_THREAD_ATTR_HPP
8 #define ZPP_INCLUDE_ZPP_THREAD_ATTR_HPP
12 #include <zephyr/kernel.h>
13 #include <zephyr/sys/__assert.h>
27 template<
class T_Rep,
class T_Period>
29 std::chrono::duration<T_Rep, T_Period>
t;
52 template <class ...T_Args>
55 set(std::forward<T_Args>(args)...);
58 template <
class T_FirstArg,
class ...T_Args>
59 constexpr
void set(T_FirstArg&& first, T_Args&&... rest) noexcept
61 set(std::forward<T_FirstArg>(first));
62 set(std::forward<T_Args>(rest)...);
65 constexpr
void set() const noexcept
84 template<
class T_Rep,
class T_Period>
88 using namespace std::chrono;
92 if (delay.t <= decltype(delay.t)::zero()) {
109 if (K_TIMEOUT_EQ(m_delay, K_FOREVER)) {
123 m_options |= K_ESSENTIAL;
125 m_options &= ~K_ESSENTIAL;
139 m_options &= ~K_USER;
151 m_options |= K_INHERIT_PERMS;
153 m_options &= ~K_INHERIT_PERMS;
166 m_options |= K_FP_REGS;
168 m_options &= ~K_FP_REGS;
182 m_options |= K_SSE_REGS;
184 m_options &= ~K_SSE_REGS;
220 uint32_t m_options{ 0 };
221 k_timeout_t m_delay{ K_NO_WAIT };
Thread creation attributes.
constexpr auto native_delay() const noexcept
get the Zephyr native delay value
constexpr void set(thread_sse_regs v) noexcept
Set the thread SSE regs flag.
constexpr void set(T_FirstArg &&first, T_Args &&... rest) noexcept
constexpr void set(thread_suspend v) noexcept
Set the thread start suspended flag.
constexpr void set(thread_fp_regs v) noexcept
Set the thread FP regs flag.
constexpr auto native_prio() const noexcept
get the Zephyr native priority value
constexpr void set() const noexcept
constexpr auto native_options() const noexcept
get the Zephyr native options value
constexpr void set(thread_user v) noexcept
Set the thread user flag.
thread_attr(const thread_attr &) noexcept=default
constexpr void set(thread_essential v) noexcept
Set the thread essential flag.
thread_attr(thread_attr &&) noexcept=default
constexpr void set(const thread_start_delay< T_Rep, T_Period > &delay) noexcept
Set the thread start delay.
constexpr void set(thread_inherit_perms v) noexcept
Set the thread inherit permisions flag.
constexpr void set(thread_prio prio) noexcept
Set the thread priority.
constexpr int native_value() const noexcept
Get the Zephyr native priority value.
constexpr k_ticks_t to_tick(const std::chrono::duration< T_Rep, T_Period > &d) noexcept
convert a duration to tick
std::chrono::duration< T_Rep, T_Period > t