userver: userver/utils/thread_name.hpp Source File
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
10USERVER_NAMESPACE_BEGIN
11
12namespace utils {
13
23
35void SetCurrentThreadName(std::string_view name);
36
46public:
50 CurrentThreadNameGuard(std::string_view name);
52
55 CurrentThreadNameGuard& operator=(const CurrentThreadNameGuard&) = delete;
56 CurrentThreadNameGuard& operator=(CurrentThreadNameGuard&&) noexcept = delete;
57
58private:
59 std::string prev_name_;
60};
61
62} // namespace utils
63
64USERVER_NAMESPACE_END