Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a6b1cd5a authored by Mike Lockwood's avatar Mike Lockwood Committed by Android (Google) Code Review
Browse files

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

parents 62e4af16 4a7f412e
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -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 "