[NFC][dfsan] Split Init and ThreadStart

This commit is contained in:
Vitaly Buka 2021-11-08 19:10:10 -08:00
parent a5b06ad39a
commit 63886c21ec
3 changed files with 2 additions and 3 deletions

View File

@ -991,7 +991,7 @@ static void DFsanInit(int argc, char **argv, char **envp) {
DFsanThread *main_thread = DFsanThread::Create(nullptr, nullptr, nullptr);
SetCurrentThread(main_thread);
main_thread->ThreadStart();
main_thread->Init();
dfsan_init_is_running = false;
dfsan_inited = true;

View File

@ -755,6 +755,7 @@ SANITIZER_INTERFACE_ATTRIBUTE void *__dfso_dlopen(
static void *DFsanThreadStartFunc(void *arg) {
DFsanThread *t = (DFsanThread *)arg;
SetCurrentThread(t);
t->Init();
return t->ThreadStart();
}

View File

@ -67,8 +67,6 @@ void DFsanThread::Destroy() {
}
thread_return_t DFsanThread::ThreadStart() {
Init();
if (!start_routine_) {
// start_routine_ == 0 if we're on the main thread or on one of the
// OS X libdispatch worker threads. But nobody is supposed to call