summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/lsan/lsan_linux.cc
diff options
context:
space:
mode:
authorFrancis Ricci <francisjricci@gmail.com>2017-03-29 21:49:47 +0000
committerFrancis Ricci <francisjricci@gmail.com>2017-03-29 21:49:47 +0000
commita79b8a22b4dcbd049837da4005e898c226e1ece4 (patch)
treea26463f1e99bc813c9ff9a7507832213be645a90 /compiler-rt/lib/lsan/lsan_linux.cc
parent1aa20001ed4f97ad3eecc385011c03a22b39fa6c (diff)
downloadbcm5719-llvm-a79b8a22b4dcbd049837da4005e898c226e1ece4.tar.gz
bcm5719-llvm-a79b8a22b4dcbd049837da4005e898c226e1ece4.zip
Move current thread data out of lsan_common on linux
Summary: Now that we have a platform-specific non-common lsan file, use it to store non-common lsan data. Reviewers: kubamracek Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D31472 llvm-svn: 299032
Diffstat (limited to 'compiler-rt/lib/lsan/lsan_linux.cc')
-rw-r--r--compiler-rt/lib/lsan/lsan_linux.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler-rt/lib/lsan/lsan_linux.cc b/compiler-rt/lib/lsan/lsan_linux.cc
index c0b6f4b6505..a60f7413a52 100644
--- a/compiler-rt/lib/lsan/lsan_linux.cc
+++ b/compiler-rt/lib/lsan/lsan_linux.cc
@@ -19,6 +19,10 @@
namespace __lsan {
+static THREADLOCAL u32 current_thread_tid = kInvalidTid;
+u32 GetCurrentThread() { return current_thread_tid; }
+void SetCurrentThread(u32 tid) { current_thread_tid = tid; }
+
static THREADLOCAL AllocatorCache allocator_cache;
AllocatorCache *GetAllocatorCache() { return &allocator_cache; }
OpenPOWER on IntegriCloud