65 template <typename Callable, typename... Args>
66 explicit
thread(Callable&& callable, Args&&... args);
74 template <typename Callable, typename... Args>
106namespace this_thread {
114void yield() noexcept;
119void sleep_for(const roo_time::Duration& duration);
124void sleep_until(const roo_time::Uptime& when);
Optional thread attributes used by backend-specific constructors.
void set_priority(uint16_t priority)
Sets requested scheduler priority.
void set_name(const char *name)
Sets thread name.
void set_stack_size(uint32_t stack_size)
Sets requested stack size in bytes.
uint16_t priority() const
Returns requested scheduler priority.
uint32_t stack_size() const
Returns requested stack size in bytes.
const char * name() const
Returns thread name, or nullptr if not set.
bool joinable() const
Returns whether the created thread is joinable.
attributes()
Creates default thread attributes.
bool operator==(const id &other) const
Equality comparison.
bool operator>(const id &other) const
Greater-than comparison.
bool operator>=(const id &other) const
Greater-than-or-equal comparison.
bool operator!=(const id &other) const
Inequality comparison.
id()
Constructs an invalid thread identifier.
bool operator<=(const id &other) const
Less-than-or-equal comparison.
bool operator<(const id &other) const
Strict weak ordering comparison.
Canonical documentation-only thread API.
void join()
Waits for the represented thread to complete.
id get_id() const noexcept
Returns identifier of the represented thread.
void swap(thread &other) noexcept
Swaps two thread handles.
bool joinable() const noexcept
Returns true if this handle represents an active thread.
void detach()
Detaches the represented thread from this handle.
thread() noexcept
Constructs a non-joinable empty thread handle.