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

Commit fe668f46 authored by Mathias Agopian's avatar Mathias Agopian Committed by Android (Google) Code Review
Browse files

Merge "double checked locking pattern is not safe on SMP"

parents 4851e21d e8db871d
Loading
Loading
Loading
Loading
+5 −4
Original line number Diff line number Diff line
@@ -73,10 +73,11 @@ protected:

sp<ProcessState> ProcessState::self()
{
    if (gProcess != NULL) return gProcess;
    
    AutoMutex _l(gProcessMutex);
    if (gProcess == NULL) gProcess = new ProcessState;
    Mutex::Autolock _l(gProcessMutex);
    if (gProcess != NULL) {
        return gProcess;
    }
    gProcess = new ProcessState;
    return gProcess;
}