ThreadSchedule 2.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::RegisteredThreadInfo Struct Reference

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

#include <thread_registry.hpp>

Public Attributes

Tid tid {}
std::thread::id stdId
std::string name
std::string componentTag
bool alive {true}
std::shared_ptr< class ThreadControlBlockcontrol

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 ThreadControlBlock. Instances are returned by ThreadRegistry 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 (ThreadControlBlock) is itself thread-safe.
Copyability / movability
Fully copyable and movable (regular value semantics).
Lifetime
A RegisteredThreadInfo 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).
  • stdId - The corresponding std::thread::id.
  • name - Human-readable name given at registration time.
  • componentTag - 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 ThreadControlBlock. 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 86 of file thread_registry.hpp.

Member Data Documentation

◆ alive

bool threadschedule::RegisteredThreadInfo::alive {true}

◆ componentTag

std::string threadschedule::RegisteredThreadInfo::componentTag

◆ control

std::shared_ptr<class ThreadControlBlock> threadschedule::RegisteredThreadInfo::control

◆ name

std::string threadschedule::RegisteredThreadInfo::name

◆ stdId

std::thread::id threadschedule::RegisteredThreadInfo::stdId

◆ tid


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