Skip to content

Commit

Permalink
Partially revert "[NFC][msan] Split ThreadStart and Init"
Browse files Browse the repository at this point in the history
I don't know if removing "if (!start_routine_)" from ThreadStart
is NFC.

This reverts commit b3267bb.
  • Loading branch information
vitalybuka committed Nov 9, 2021
1 parent 6cad45d commit a5b06ad
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion compiler-rt/lib/msan/msan_thread.cpp
Expand Up @@ -65,7 +65,18 @@ void MsanThread::Destroy() {
DTLS_Destroy();
}

thread_return_t MsanThread::ThreadStart() { return start_routine_(arg_); }
thread_return_t MsanThread::ThreadStart() {
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
// ThreadStart() for the worker threads.
return 0;
}

thread_return_t res = start_routine_(arg_);

return res;
}

MsanThread::StackBounds MsanThread::GetStackBounds() const {
if (!stack_switching_)
Expand Down

0 comments on commit a5b06ad

Please sign in to comment.