aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/global/mock_modules/module1_defs/test_variable.cpp
blob: 78912be6609b1d7d71bbc3876dbaadb6468f7f52 (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
28
29
30
31
32
33
34
35
36
37
38
#include "direct_access.h"

#include <library/cpp/yt/global/mock_modules/module1_public/test_tag.h>

#include <library/cpp/yt/global/variable.h>

namespace NYT {

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

YT_DEFINE_TRACKED_GLOBAL(int, TestVariable1, TestTag1, 42);
YT_DEFINE_TRACKED_THREAD_LOCAL(int, TlsVariable, ThreadLocalTag, 0);

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

int GetTestVariable1()
{
    return TestVariable1.Get();
}

void SetTestVariable1(int val)
{
    TestVariable1.Set(val);
}

int GetTlsVariable()
{
    return TlsVariable();
}

void SetTlsVariable(int val)
{
    TlsVariable() = val;
}

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

} // namespace NYT