ThreadSchedule 1.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").
  • alivetrue 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 81 of file thread_registry.hpp.

Member Data Documentation

◆ alive

bool threadschedule::RegisteredThreadInfo::alive {true}

Definition at line 87 of file thread_registry.hpp.

◆ componentTag

std::string threadschedule::RegisteredThreadInfo::componentTag

Definition at line 86 of file thread_registry.hpp.

◆ control

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

Definition at line 88 of file thread_registry.hpp.

◆ name

std::string threadschedule::RegisteredThreadInfo::name

Definition at line 85 of file thread_registry.hpp.

◆ stdId

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

Definition at line 84 of file thread_registry.hpp.

◆ tid

Tid threadschedule::RegisteredThreadInfo::tid {}

Definition at line 83 of file thread_registry.hpp.


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