Partially revert "[NFC][msan] Split ThreadStart and Init"

I don't know if removing "if (!start_routine_)" from ThreadStart
is NFC.

This reverts commit b3267bb3af.
This commit is contained in:
Vitaly Buka 2021-11-08 19:12:56 -08:00
parent 6cad45d5c6
commit a5b06ad39a
1 changed files with 12 additions and 1 deletions

View File

@ -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_)