userver: utils::CurrentThreadNameGuard Class Reference
⚠️ This is the documentation for an old userver version. Click here to switch to the latest version.
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages Concepts
utils::CurrentThreadNameGuard Class Reference

#include <userver/utils/thread_name.hpp>

Detailed Description

RAII helper to run some code with a temporary current thread name.

This might be useful for spawning external library threads if no other customisation points are available. All restrictions for thread name operations apply.

Note
There is a chance of failure during thread name update on scope exit. No errors will be reported in this case.

Definition at line 45 of file thread_name.hpp.

Public Member Functions

 CurrentThreadNameGuard (std::string_view name)
 Set the name of the current thread in the current scope.
 
 CurrentThreadNameGuard (const CurrentThreadNameGuard &)=delete
 
 CurrentThreadNameGuard (CurrentThreadNameGuard &&) noexcept=delete
 
CurrentThreadNameGuardoperator= (const CurrentThreadNameGuard &)=delete
 
CurrentThreadNameGuardoperator= (CurrentThreadNameGuard &&) noexcept=delete
 

Constructor & Destructor Documentation

◆ CurrentThreadNameGuard()

utils::CurrentThreadNameGuard::CurrentThreadNameGuard ( std::string_view name)

Set the name of the current thread in the current scope.

Parameters
nametemporary thread name
Exceptions
std::system_erroron error

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