ThreadSchedule 1.0.0
Modern C++ thread management library
Loading...
Searching...
No Matches
threadschedule::ThreadInfo Class Reference

Static utility class providing hardware and scheduling introspection. More...

#include <thread_wrapper.hpp>

Static Public Member Functions

static auto hardware_concurrency () -> unsigned int
static auto get_thread_id ()
static auto get_current_policy () -> std::optional< SchedulingPolicy >
static auto get_current_priority () -> std::optional< int >

Detailed Description

Static utility class providing hardware and scheduling introspection.

All methods are static; the class holds no state and should not be instantiated.

Provided Queries
  • hardware_concurrency() - delegates to std::thread::hardware_concurrency().
  • get_thread_id() - returns the OS-level thread ID (Linux TID via syscall(SYS_gettid), Windows thread ID via GetCurrentThreadId()).
  • get_current_policy() - returns the calling thread's scheduling policy. On Windows this always returns SchedulingPolicy::OTHER.
  • get_current_priority() - returns the calling thread's scheduling priority.
Thread Safety
All methods are thread-safe (they query per-thread or immutable system state).

Definition at line 1045 of file thread_wrapper.hpp.

Member Function Documentation

◆ get_current_policy()

auto threadschedule::ThreadInfo::get_current_policy ( ) -> std::optional<SchedulingPolicy>
inlinestatic

Definition at line 1062 of file thread_wrapper.hpp.

◆ get_current_priority()

auto threadschedule::ThreadInfo::get_current_priority ( ) -> std::optional<int>
inlinestatic

Definition at line 1078 of file thread_wrapper.hpp.

◆ get_thread_id()

auto threadschedule::ThreadInfo::get_thread_id ( )
inlinestatic

Definition at line 1053 of file thread_wrapper.hpp.

◆ hardware_concurrency()

auto threadschedule::ThreadInfo::hardware_concurrency ( ) -> unsigned int
inlinestatic

Definition at line 1048 of file thread_wrapper.hpp.


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