Skip to content

Commit 63886c2

Browse files
committed
[NFC][dfsan] Split Init and ThreadStart
1 parent a5b06ad commit 63886c2

File tree

3 files changed

+2
-3
lines changed

3 files changed

+2
-3
lines changed

compiler-rt/lib/dfsan/dfsan.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ static void DFsanInit(int argc, char **argv, char **envp) {
991991

992992
DFsanThread *main_thread = DFsanThread::Create(nullptr, nullptr, nullptr);
993993
SetCurrentThread(main_thread);
994-
main_thread->ThreadStart();
994+
main_thread->Init();
995995

996996
dfsan_init_is_running = false;
997997
dfsan_inited = true;

compiler-rt/lib/dfsan/dfsan_custom.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -755,6 +755,7 @@ SANITIZER_INTERFACE_ATTRIBUTE void *__dfso_dlopen(
755755
static void *DFsanThreadStartFunc(void *arg) {
756756
DFsanThread *t = (DFsanThread *)arg;
757757
SetCurrentThread(t);
758+
t->Init();
758759
return t->ThreadStart();
759760
}
760761

compiler-rt/lib/dfsan/dfsan_thread.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,6 @@ void DFsanThread::Destroy() {
6767
}
6868

6969
thread_return_t DFsanThread::ThreadStart() {
70-
Init();
71-
7270
if (!start_routine_) {
7371
// start_routine_ == 0 if we're on the main thread or on one of the
7472
// OS X libdispatch worker threads. But nobody is supposed to call

0 commit comments

Comments
 (0)