dfx 0.1.0
Linux-based dynamic dataflow executor
Loading...
Searching...
No Matches
Thread.hpp File Reference

Small helpers to set and query the current thread name. More...

Include dependency graph for Thread.hpp:

Go to the source code of this file.

Functions

void dfx::Utils::Thread::setName (std::string_view name, std::error_code &ec) noexcept
 Set the calling thread name.
void dfx::Utils::Thread::setName (std::string_view name)
 Set the calling thread name.
std::string dfx::Utils::Thread::getName (std::error_code &ec) noexcept
 Get the calling thread name.
std::string dfx::Utils::Thread::getName ()
 Get the calling thread name.

Detailed Description

Small helpers to set and query the current thread name.

These helpers set or retrieve the calling thread name, typically for debugging, logging, and observability (e.g., easier identification in top/htop, debuggers, profilers, crash dumps).

Two APIs are provided for each operation:

  • An overload taking a std::error_code& for no-throw usage (errors are reported through ec).
  • A convenience overload without std::error_code that reports failures by throwing (typically std::system_error, depending on implementation).
Note
Thread names are limited to 15 characters (excluding '\0')