ThreadSchedule 3.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::detail::registered_thread_info_backend Struct Reference

Snapshot of metadata for a single registered thread. More...

#include <thread_control_block.hpp>

Public Attributes

native_thread_id tid {}
 
std::thread::id std_id
 
std::string name
 
std::string component
 
bool alive { true }
 
std::shared_ptr< class thread_control_blockcontrol
 

Detailed Description

Snapshot of metadata for a single registered thread.

This is a POD-like value type that captures thread identity, lifecycle state, and an optional handle to the underlying thread_control_block. Instances are returned by thread_registry_backend queries and are safe to store, copy, and inspect from any thread.

Thread safety
Instances are plain value types and carry no internal synchronisation. Concurrent reads are safe; concurrent read/write on the same instance is not. The control shared_ptr is ref-counted and the pointee (thread_control_block) is itself thread-safe.
Copyability / movability
Fully copyable and movable (regular value semantics).
Lifetime
A registered_thread_info_backend is a snapshot - it may outlive the thread it describes. The alive flag reflects the state at the time the snapshot was taken; it is not updated retroactively when the thread unregisters.
Fields
  • tid - OS-level thread identifier (pid_t on Linux via gettid(), DWORD on Windows).
  • std_id - The corresponding std::thread::id.
  • name - Human-readable name given at registration time.
  • component - Optional logical grouping tag (e.g. "io", "compute").
  • alive - true while the thread is registered; set to false when the thread calls unregister_current_thread().
  • control - Shared pointer to the thread's thread_control_block. May be nullptr if the thread was registered without a control block (i.e. via the name-only overload of register_current_thread()).

Definition at line 69 of file thread_control_block.hpp.

Member Data Documentation

◆ alive

bool threadschedule::detail::registered_thread_info_backend::alive { true }

Definition at line 75 of file thread_control_block.hpp.

◆ component

std::string threadschedule::detail::registered_thread_info_backend::component

Definition at line 74 of file thread_control_block.hpp.

◆ control

std::shared_ptr<class thread_control_block> threadschedule::detail::registered_thread_info_backend::control

Definition at line 76 of file thread_control_block.hpp.

◆ name

std::string threadschedule::detail::registered_thread_info_backend::name

Definition at line 73 of file thread_control_block.hpp.

◆ std_id

std::thread::id threadschedule::detail::registered_thread_info_backend::std_id

Definition at line 72 of file thread_control_block.hpp.

◆ tid


The documentation for this struct was generated from the following file: