Class representing a single thread of execution.
More...
#include <generic/dius/thread.h>
|
template<di::concepts::MovableValue F, di::concepts::MovableValue... Args>
requires (di::concepts::InvocableTo<F, void, Args...>) |
static auto | create (F &&function, Args &&... args) -> di::Result< Thread > |
|
Class representing a single thread of execution.
This class is modeled after the C++ standard library std::thread.
- Warning
- All Thread objects must be joined before destruction, or the program will terminate.
◆ Id
◆ Thread() [1/3]
◆ Thread() [2/3]
dius::Thread::Thread |
( |
Thread const & | | ) |
|
|
delete |
◆ Thread() [3/3]
dius::Thread::Thread |
( |
Thread && | other | ) |
|
|
inline |
◆ ~Thread()
dius::Thread::~Thread |
( |
| ) |
|
|
inline |
◆ create()
template<di::concepts::MovableValue F, di::concepts::MovableValue... Args>
requires (di::concepts::InvocableTo<F, void, Args...>)
static auto dius::Thread::create |
( |
F && | function, |
|
|
Args &&... | args ) -> di::Result<Thread> |
|
inlinestatic |
◆ get_id()
auto dius::Thread::get_id |
( |
| ) |
const -> Id |
|
inlinenodiscard |
◆ join()
auto dius::Thread::join |
( |
| ) |
-> di::Result<void> |
|
inline |
Wait for the spawned thread's execution to terminate.
- Warning
- It is undefined behavior to call this method concurrently from different threads.
- Returns
- Returns an error if the operation failed.
◆ joinable()
auto dius::Thread::joinable |
( |
| ) |
const -> bool |
|
inlinenodiscard |
◆ operator=() [1/2]
◆ operator=() [2/2]
auto dius::Thread::operator= |
( |
Thread const & | | ) |
-> Thread &=delete |
|
delete |
◆ tag_invoke
void tag_invoke |
( |
di::Tag< di::swap > | , |
|
|
Thread & | a, |
|
|
Thread & | b ) |
|
friend |
The documentation for this class was generated from the following file: