aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2023-12-11 21:12:58 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2023-12-11 21:32:41 +0300
commit0f2dee024aa755f1a8e16ecfd1e21c1043ead515 (patch)
treeacff78bac1de9e150af09bad37661256b1c76bfb
parent9735e616e9f7a0d2696ec558a1e6bbb1ca0e0654 (diff)
downloadydb-0f2dee024aa755f1a8e16ecfd1e21c1043ead515.tar.gz
Intermediate changes
-rw-r--r--contrib/libs/clang16-rt/lib/lsan/lsan_thread.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/contrib/libs/clang16-rt/lib/lsan/lsan_thread.cpp b/contrib/libs/clang16-rt/lib/lsan/lsan_thread.cpp
index 137c7e4e4f..bf7fcd833d 100644
--- a/contrib/libs/clang16-rt/lib/lsan/lsan_thread.cpp
+++ b/contrib/libs/clang16-rt/lib/lsan/lsan_thread.cpp
@@ -59,12 +59,21 @@ void ThreadFinish() {
SetCurrentThread(kInvalidTid);
}
+struct ThreadsGuard {
+ ThreadsGuard() {
+ LockThreadRegistry();
+ }
+ ~ThreadsGuard() {
+ UnlockThreadRegistry();
+ }
+};
+
ThreadContext *CurrentThreadContext() {
if (!thread_registry)
return nullptr;
if (GetCurrentThread() == kInvalidTid)
return nullptr;
- // No lock needed when getting current thread.
+ ThreadsGuard lock;
return (ThreadContext *)thread_registry->GetThreadLocked(GetCurrentThread());
}