Class representing a single thread of execution.
More...
#include <generic/dius/thread.h>
|
| | Thread ()=default |
| | Thread (Thread const &)=delete |
| | Thread (Thread &&other) |
| | ~Thread () |
| auto | operator= (Thread const &) -> Thread &=delete |
| auto | operator= (Thread &&other) -> Thread & |
| auto | joinable () const -> bool |
| auto | get_id () const -> Id |
| auto | join () -> di::Result< void > |
| | Wait for the spawned thread's execution to terminate.
|
|
| template<di::concepts::MovableValue F, di::concepts::MovableValue... Args> |
| static auto | create (F &&function, Args &&... args) -> di::Result< Thread > |
|
| void | tag_invoke (di::Tag< di::swap >, Thread &a, Thread &b) |
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>
| 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]
| auto dius::Thread::operator= |
( |
Thread && | other | ) |
-> Thread & |
|
inline |
◆ 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: