summaryrefslogtreecommitdiffstats
path: root/libs/binder/ProcessState.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'libs/binder/ProcessState.cpp')
-rw-r--r--libs/binder/ProcessState.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/libs/binder/ProcessState.cpp b/libs/binder/ProcessState.cpp
index 9fa412c..5399e52 100644
--- a/libs/binder/ProcessState.cpp
+++ b/libs/binder/ProcessState.cpp
@@ -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;
}