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 221 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. More... | |
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. More... | |
bool | joinable () const noexcept |
Query if the thread is joinable. More... | |
void | join () |
Block until the thread finishes. More... | |
void | detach () |
Detaches a thread from its handle and allows it to execute independently. More... | |
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. More... | |
|
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 350 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.
|
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 282 of file thread.hpp.
|
inlinenoexcept |
Swap threads.
[in,out] | t | Thread to swap data with. |
Definition at line 273 of file thread.hpp.