aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/misc/thread_name.h
blob: 5f87cb1fd80b27ce008baa576a64854b69534dfb (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
#pragma once

#include <util/generic/string.h>

#include <array>

namespace NYT {

////////////////////////////////////////////////////////////////////////////////

struct TThreadName
{
    static constexpr int BufferCapacity = 16; // including zero terminator
    std::array<char, BufferCapacity> Buffer{}; // zero-terminated
    int Length; // not including zero terminator

    TString ToString() const;
};

TThreadName GetCurrentThreadName();

////////////////////////////////////////////////////////////////////////////////

} // namespace NYT