diff options
| author | 2016-09-19 21:51:17 +0000 | |
|---|---|---|
| committer | 2016-09-19 21:51:17 +0000 | |
| commit | 6b2a372d622d0d3d71ff5f8587420d9a435165c4 (patch) | |
| tree | a79c6e700418acc36bf1c7fc81d4bee7c7601ad7 | |
| parent | 865ec7dda5c76be0de89ad68d6bf99fff0f1a5ab (diff) | |
| parent | 433a36e9dfb222ceb3c21d6c3897ea72ad64b4f1 (diff) | |
Fix deadlock in AcitivityManagerService. am: 67e05b4d28
am: 433a36e9df
Change-Id: I1ec79a8382d987f6909237ba0fb13dfbd32eb565
| -rw-r--r-- | services/core/java/com/android/server/am/ActivityManagerService.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/services/core/java/com/android/server/am/ActivityManagerService.java b/services/core/java/com/android/server/am/ActivityManagerService.java index f65fab8d98aa..91f493c98e2d 100644 --- a/services/core/java/com/android/server/am/ActivityManagerService.java +++ b/services/core/java/com/android/server/am/ActivityManagerService.java @@ -3847,16 +3847,19 @@ public final class ActivityManagerService extends ActivityManagerNative app.killed = false; app.killedByAm = false; checkTime(startTime, "startProcess: starting to update pids map"); + ProcessRecord oldApp; + synchronized (mPidsSelfLocked) { + oldApp = mPidsSelfLocked.get(startResult.pid); + } + // If there is already an app occupying that pid that hasn't been cleaned up + if (oldApp != null && !app.isolated) { + // Clean up anything relating to this pid first + Slog.w(TAG, "Reusing pid " + startResult.pid + + " while app is still mapped to it"); + cleanUpApplicationRecordLocked(oldApp, false, false, -1, + true /*replacingPid*/); + } synchronized (mPidsSelfLocked) { - ProcessRecord oldApp; - // If there is already an app occupying that pid that hasn't been cleaned up - if ((oldApp = mPidsSelfLocked.get(startResult.pid)) != null && !app.isolated) { - // Clean up anything relating to this pid first - Slog.w(TAG, "Reusing pid " + startResult.pid - + " while app is still mapped to it"); - cleanUpApplicationRecordLocked(oldApp, false, false, -1, - true /*replacingPid*/); - } this.mPidsSelfLocked.put(startResult.pid, app); if (isActivityProcess) { Message msg = mHandler.obtainMessage(PROC_START_TIMEOUT_MSG); |