The jthread class is a wrapper around std::thread that automatically rejoins the thread on destruction.
More...
#include <thread.hpp>
|
| using | native_handle_type = std::thread::native_handle_type |
| | The type of the implementation defined thread handle.
|
| |
|
| static unsigned int | hardware_concurrency () noexcept |
| | Get the number of concurrent threads supported by the implementation.
|
| |
The jthread class is a wrapper around std::thread that automatically rejoins the thread on destruction.
Definition at line 17 of file thread.hpp.
◆ native_handle_type
The type of the implementation defined thread handle.
Definition at line 23 of file thread.hpp.
◆ jthread() [1/4]
| tenno::jthread::jthread |
( |
| ) |
|
|
defaultnoexcept |
◆ jthread() [2/4]
| tenno::jthread::jthread |
( |
const jthread & | | ) |
|
|
delete |
◆ jthread() [3/4]
| tenno::jthread::jthread |
( |
jthread && | other | ) |
|
|
inlinenoexcept |
Construct a new jthread object by moving the other object.
- Parameters
-
| other | The other jthread object to move |
Definition at line 35 of file thread.hpp.
◆ jthread() [4/4]
template<class F , class... Args>
| tenno::jthread::jthread |
( |
F && | f, |
|
|
Args &&... | args ) |
|
inlineexplicit |
Construct a new jthread object with the given function and arguments.
- Template Parameters
-
| F | The type of the function to execute |
| Args | The type of the arguments to pass to the function |
- Parameters
-
| f | The function to execute |
| args | The arguments to pass to the function |
Definition at line 49 of file thread.hpp.
◆ ~jthread()
| tenno::jthread::~jthread |
( |
| ) |
|
|
inline |
◆ detach()
| void tenno::jthread::detach |
( |
| ) |
|
|
inline |
◆ get_id()
| std::thread::id tenno::jthread::get_id |
( |
| ) |
const |
|
inlinenoexcept |
◆ hardware_concurrency()
| static unsigned int tenno::jthread::hardware_concurrency |
( |
| ) |
|
|
inlinestaticnoexcept |
Get the number of concurrent threads supported by the implementation.
- Returns
- unsigned int The number of concurrent threads supported by the implementation
Definition at line 90 of file thread.hpp.
◆ join()
| void tenno::jthread::join |
( |
| ) |
|
|
inline |
◆ joinable()
| bool tenno::jthread::joinable |
( |
| ) |
const |
|
inlinenoexcept |
◆ native_handle()
Get the native handle of the thread.
- Returns
- native_handle_type The native handle of the thread
Definition at line 78 of file thread.hpp.
◆ swap()
◆ id
| std::thread::id tenno::jthread::id |
The documentation for this class was generated from the following file: