summaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/logging/logger.cpp
diff options
context:
space:
mode:
authorlukyan <[email protected]>2023-12-05 19:07:41 +0300
committerlukyan <[email protected]>2023-12-05 20:50:57 +0300
commitd5b84ed65f77eab0135b9d0ee025556f4507b62b (patch)
tree5c5db90ad950923a5554c4a0f5fac239b3f44c53 /library/cpp/yt/logging/logger.cpp
parentddadddf4718f23838ed4ffb8e6aa1f126301cf55 (diff)
Use volatile TLS in library/cpp/yt
Diffstat (limited to 'library/cpp/yt/logging/logger.cpp')
-rw-r--r--library/cpp/yt/logging/logger.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/library/cpp/yt/logging/logger.cpp b/library/cpp/yt/logging/logger.cpp
index 4ee5c1a01b0..c11457f836f 100644
--- a/library/cpp/yt/logging/logger.cpp
+++ b/library/cpp/yt/logging/logger.cpp
@@ -93,8 +93,8 @@ TMessageStringBuilder::TPerThreadCache* TMessageStringBuilder::GetCache()
if (CacheDestroyed_) {
return nullptr;
}
- static thread_local TPerThreadCache Cache;
- Cache_ = &Cache;
+ static YT_THREAD_LOCAL(TPerThreadCache) Cache;
+ Cache_ = &GetTlsRef(Cache);
return Cache_;
}
@@ -103,8 +103,8 @@ TMessageStringBuilder::TPerThreadCache::~TPerThreadCache()
TMessageStringBuilder::DisablePerThreadCache();
}
-thread_local TMessageStringBuilder::TPerThreadCache* TMessageStringBuilder::Cache_;
-thread_local bool TMessageStringBuilder::CacheDestroyed_;
+YT_THREAD_LOCAL(TMessageStringBuilder::TPerThreadCache*) TMessageStringBuilder::Cache_;
+YT_THREAD_LOCAL(bool) TMessageStringBuilder::CacheDestroyed_;
} // namespace NDetail
@@ -126,7 +126,7 @@ Y_WEAK ILogManager* GetDefaultLogManager()
////////////////////////////////////////////////////////////////////////////////
-thread_local ELogLevel ThreadMinLogLevel = ELogLevel::Minimum;
+YT_THREAD_LOCAL(ELogLevel) ThreadMinLogLevel = ELogLevel::Minimum;
void SetThreadMinLogLevel(ELogLevel minLogLevel)
{