aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/system/thread_id.cpp
blob: c4eef110b2bff814a17fa703926e466003f10c81 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include "thread_id.h"

#include <util/system/thread.h>

namespace NYT {

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

thread_local TSequentialThreadId CachedSequentialThreadId = InvalidSequentialThreadId;
std::atomic<TSequentialThreadId> SequentialThreadIdGenerator = InvalidSequentialThreadId;

TSystemThreadId GetSystemThreadId()
{
    static_assert(std::is_same_v<TSystemThreadId, ::TThread::TId>);
    return ::TThread::CurrentThreadNumericId();
}

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

} // namespace NYT::NThreading