blob: 233808f99f4136e9bbab4647230d184b581e1047 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#pragma once
#include <util/generic/string.h>
#include <array>
namespace NYT {
////////////////////////////////////////////////////////////////////////////////
struct TThreadName
{
TThreadName() = default;
TThreadName(const TString& name);
TStringBuf ToStringBuf() const;
static constexpr int BufferCapacity = 16; // including zero terminator
std::array<char, BufferCapacity> Buffer{}; // zero-terminated
int Length = 0; // not including zero terminator
};
TThreadName GetCurrentThreadName();
////////////////////////////////////////////////////////////////////////////////
} // namespace NYT
|