C++11 compliant implementation of thread, however uses the time point from out chrono header instead of the specified one. More...
C++11 compliant implementation of thread, however uses the time point from out chrono header instead of the specified one.
Definition at line 214 of file thread.hpp.
#include <thread.hpp>
Public Types | |
using | id = thread_id |
The id is of type thread_id -. | |
using | native_handle_type = kernel_pid_t |
The native handle type is the kernel_pid_t of RIOT. | |
Public Member Functions | |
thread () noexcept | |
Per default, an uninitialized thread is created. | |
template<class F , class... Args> | |
thread (F &&f, Args &&... args) | |
Create a thread from a functor and arguments for it. | |
thread (const thread &)=delete | |
Disallow copy constructor. | |
thread (thread &&t) noexcept | |
Move constructor. | |
thread & | operator= (const thread &)=delete |
Disallow copy assignment operator. | |
thread & | operator= (thread &&) noexcept |
Move assignment operator. | |
void | swap (thread &t) noexcept |
Swap threads. | |
bool | joinable () const noexcept |
Query if the thread is joinable. | |
void | join () |
Block until the thread finishes. | |
void | detach () |
Detaches a thread from its handle and allows it to execute independently. | |
id | get_id () const noexcept |
Returns the id of a thread. | |
native_handle_type | native_handle () noexcept |
Returns the native handle to a thread. | |
Static Public Member Functions | |
static unsigned | hardware_concurrency () noexcept |
Returns the number of concurrent threads supported by the underlying hardware. | |
using riot::thread::id = thread_id |
The id is of type thread_id
-.
Definition at line 219 of file thread.hpp.
The native handle type is the kernel_pid_t
of RIOT.
Definition at line 223 of file thread.hpp.
|
inlinenoexcept |
Per default, an uninitialized thread is created.
Definition at line 228 of file thread.hpp.
|
explicit |
Create a thread from a functor and arguments for it.
[in] | f | Functor to run as a thread. |
[in] | args | Arguments passed to the functor. |
Definition at line 343 of file thread.hpp.
|
inlinenoexcept |
Move constructor.
Definition at line 245 of file thread.hpp.
void riot::thread::detach | ( | ) |
Detaches a thread from its handle and allows it to execute independently.
The thread cleans up its resources when it finishes.
|
inlinenoexcept |
Returns the id of a thread.
Definition at line 292 of file thread.hpp.
|
staticnoexcept |
Returns the number of concurrent threads supported by the underlying hardware.
Since there is no RIOT API to query this information, the function always returns 1;
void riot::thread::join | ( | ) |
Block until the thread finishes.
Leads to an error if the thread is not joinable or a thread joins itself.
|
inlinenoexcept |
Query if the thread is joinable.
true
if the thread is joinable, false
otherwise. Definition at line 275 of file thread.hpp.
|
inlinenoexcept |
Returns the native handle to a thread.
Definition at line 296 of file thread.hpp.
Move assignment operator.
Definition at line 361 of file thread.hpp.
|
inlinenoexcept |
Swap threads.
[in,out] | t | Thread to swap data with. |
Definition at line 266 of file thread.hpp.