userver
C++ Async Framework
Toggle main menu visibility
Loading...
Searching...
No Matches
thread_name.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <string>
4
#include <string_view>
5
9
10
USERVER_NAMESPACE_BEGIN
11
12
namespace
utils
{
13
22
std::string
GetCurrentThreadName
();
23
35
void
SetCurrentThreadName
(std::string_view name);
36
45
class
CurrentThreadNameGuard
{
46
public
:
50
CurrentThreadNameGuard
(std::string_view name);
51
~CurrentThreadNameGuard
();
52
53
CurrentThreadNameGuard
(
const
CurrentThreadNameGuard
&) =
delete
;
54
CurrentThreadNameGuard
(
CurrentThreadNameGuard
&&) noexcept = delete;
55
CurrentThreadNameGuard
& operator=(const
CurrentThreadNameGuard
&) = delete;
56
CurrentThreadNameGuard
& operator=(
CurrentThreadNameGuard
&&) noexcept = delete;
57
58
private:
59
std
::
string
prev_name_;
60
};
61
62
}
// namespace utils
63
64
USERVER_NAMESPACE_END
userver
utils
thread_name.hpp
Generated on
for userver by
Doxygen
1.17.0