Looks up an OS thread by its name via /proc and provides scheduling control.
On construction, scans /proc/self/task/ to find a thread whose comm matches the given name. If found, the Linux TID is cached and subsequent calls operate on that TID via sched_setscheduler / sched_setaffinity (TID-based syscalls, not pthread_setschedparam).
- Platform Support
- Linux only. On Windows every method is a no-op or returns
errc::function_not_supported, and found() always returns false.
- Snapshot Semantics
- The /proc scan happens once at construction time. If the target thread exits or changes its name after construction, this view becomes stale. There is no live tracking.
- Thread Name Limit
- Linux thread names are limited to 15 characters. Names longer than 15 characters will never match, and set_name() rejects them.
- Scheduling
- Uses
sched_setscheduler(tid, ...) rather than pthread_setschedparam(). Changing real-time policies may require CAP_SYS_NICE.
- Copyability / Movability
- Trivially copyable and movable (stores only a TID/handle).
- Thread Safety
- Methods are safe to call concurrently from different threads as long as the target thread still exists, but the class itself provides no internal synchronization.
Definition at line 877 of file thread_wrapper.hpp.