#include <thread.hpp>
◆ ManagedThread() [1/3]
template<class Fn , class... Args>
requires (std::invocable<Fn, std::stop_token, Args...> || std::invocable<Fn, Args...>)
| threadman::ManagedThread::ManagedThread |
( |
Options |
opts, |
|
|
Fn && |
fn, |
|
|
Args &&... |
args |
|
) |
| |
|
inlineexplicit |
Construct a managed thread; fn may take an optional leading std::stop_token.
Registers with opts.manager (or the singleton).
◆ ManagedThread() [2/3]
| threadman::ManagedThread::ManagedThread |
( |
const ManagedThread & |
| ) |
|
|
delete |
◆ ManagedThread() [3/3]
◆ ~ManagedThread()
| threadman::ManagedThread::~ManagedThread |
( |
| ) |
|
|
inline |
◆ control_block()
| std::shared_ptr< ControlBlock > threadman::ManagedThread::control_block |
( |
| ) |
const |
|
inlinenoexcept |
◆ current()
Returns a pointer to the ControlBlock of the currently-executing ManagedThread, or nullptr when called from a thread that wasn't constructed via this class.
◆ detach()
| void threadman::ManagedThread::detach |
( |
| ) |
|
|
inline |
◆ display_info()
| static const comms::DisplayInfo & threadman::ManagedThread::display_info |
( |
| ) |
|
|
inlinestatic |
◆ failed()
| bool threadman::ManagedThread::failed |
( |
| ) |
const |
|
inlinenoexcept |
◆ get_stop_source()
| std::stop_source threadman::ManagedThread::get_stop_source |
( |
| ) |
|
|
inlinenoexcept |
◆ get_stop_token()
| std::stop_token threadman::ManagedThread::get_stop_token |
( |
| ) |
const |
|
inlinenoexcept |
◆ id()
| std::uint64_t threadman::ManagedThread::id |
( |
| ) |
const |
|
inlinenoexcept |
◆ is_core()
| bool threadman::ManagedThread::is_core |
( |
| ) |
const |
|
inlinenoexcept |
◆ join()
| void threadman::ManagedThread::join |
( |
| ) |
|
|
inline |
◆ joinable()
| bool threadman::ManagedThread::joinable |
( |
| ) |
const |
|
inlinenoexcept |
◆ name()
| const std::string & threadman::ManagedThread::name |
( |
| ) |
const |
|
inlinenoexcept |
◆ native_id()
| std::uint64_t threadman::ManagedThread::native_id |
( |
| ) |
const |
|
inlinenoexcept |
◆ native_thread_id()
| std::thread::id threadman::ManagedThread::native_thread_id |
( |
| ) |
const |
|
inlinenoexcept |
Underlying std::jthread::id().
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ pool_id()
| std::optional< std::uint64_t > threadman::ManagedThread::pool_id |
( |
| ) |
const |
|
inlinenoexcept |
◆ request_stop()
| bool threadman::ManagedThread::request_stop |
( |
| ) |
|
|
inlinenoexcept |
Request the thread to stop. The body sees tok.stop_requested().
◆ run_duration()
| std::chrono::nanoseconds threadman::ManagedThread::run_duration |
( |
| ) |
const |
|
inlinenoexcept |
Time elapsed since the worker body entered; once exited, the duration from started_at to ended_at.
Returns 0 if not yet started.
◆ snapshot()
◆ state()
◆ unregister_from_manager()
| void threadman::ManagedThread::unregister_from_manager |
( |
| ) |
|
|
inlinenoexcept |
The documentation for this class was generated from the following files: