Merge "libutils: Fix race condition in Thread::requestExitAndWait()"

This commit is contained in:
Mike Lockwood
2011-01-24 15:26:31 -08:00
committed by Android (Google) Code Review

View File

@@ -799,6 +799,9 @@ void Thread::requestExit()
status_t Thread::requestExitAndWait()
{
// hold a reference so mThreadExitedCondition is not destroyed before wait() returns
sp<Thread> strong(mHoldSelf);
if (mThread == getThreadId()) {
LOGW(
"Thread (this=%p): don't call waitForExit() from this "