summaryrefslogtreecommitdiff
path: root/lib/asan/asan_rtl.cc
diff options
context:
space:
mode:
authorVitaly Buka <vitalybuka@google.com>2017-08-09 00:38:57 +0000
committerVitaly Buka <vitalybuka@google.com>2017-08-09 00:38:57 +0000
commit5f5d782f41c4db73d704a0d1d15dceb8f3f8e3e7 (patch)
treef03d50c42dbd1084c7a09ff171d6fff4656b06a6 /lib/asan/asan_rtl.cc
parentf569d19ea0c83ee6e59b64135727b0a2cd8434f8 (diff)
[asan] Refactor thread creation bookkeeping
Summary: This is a pure refactoring change. It paves the way for OS-specific implementations, such as Fuchsia's, that can do most of the per-thread bookkeeping work in the creator thread before the new thread actually starts. This model is simpler and cleaner, avoiding some race issues that the interceptor code for thread creation has to do for the existing OS-specific implementations. Submitted on behalf of Roland McGrath. Reviewers: vitalybuka, alekseyshl, kcc Reviewed By: alekseyshl Subscribers: phosek, filcab, llvm-commits, kubamracek Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D36385 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@310432 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/asan/asan_rtl.cc')
-rw-r--r--lib/asan/asan_rtl.cc7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/asan/asan_rtl.cc b/lib/asan/asan_rtl.cc
index e32872452..6e83671ab 100644
--- a/lib/asan/asan_rtl.cc
+++ b/lib/asan/asan_rtl.cc
@@ -451,13 +451,8 @@ static void AsanInitInternal() {
InitTlsSize();
// Create main thread.
- AsanThread *main_thread = AsanThread::Create(
- /* start_routine */ nullptr, /* arg */ nullptr, /* parent_tid */ 0,
- /* stack */ nullptr, /* detached */ true);
+ AsanThread *main_thread = CreateMainThread();
CHECK_EQ(0, main_thread->tid());
- SetCurrentThread(main_thread);
- main_thread->ThreadStart(internal_getpid(),
- /* signal_thread_is_registered */ nullptr);
force_interface_symbols(); // no-op.
SanitizerInitializeUnwinder();