summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2011-04-29 16:44:20 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2011-04-29 16:44:20 -0700
commit92618f5fd9e4a0469d60cab39765b7c820c1976b (patch)
treef19e9658ba3496bcd10b4c814c0cfcdf85a08d8d
parent5eb49e0f1e8e03e8808d8d7da6d5ffb761400e0b (diff)
parent52749c0b1117a05a9c853b7d54f69a281f69cf3c (diff)
downloadframeworks_base-92618f5fd9e4a0469d60cab39765b7c820c1976b.zip
frameworks_base-92618f5fd9e4a0469d60cab39765b7c820c1976b.tar.gz
frameworks_base-92618f5fd9e4a0469d60cab39765b7c820c1976b.tar.bz2
am 52749c0b: am 03daee63: Merge "frameworks/base: acquire lock on am only when needed"
* commit '52749c0b1117a05a9c853b7d54f69a281f69cf3c': frameworks/base: acquire lock on am only when needed
-rw-r--r--services/java/com/android/server/am/ActivityManagerService.java15
1 files changed, 11 insertions, 4 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java
index 4f7b010..01ae522 100644
--- a/services/java/com/android/server/am/ActivityManagerService.java
+++ b/services/java/com/android/server/am/ActivityManagerService.java
@@ -7037,18 +7037,25 @@ public final class ActivityManagerService extends ActivityManagerNative
* to append various headers to the dropbox log text.
*/
private void appendDropBoxProcessHeaders(ProcessRecord process, StringBuilder sb) {
+ // Watchdog thread ends up invoking this function (with
+ // a null ProcessRecord) to add the stack file to dropbox.
+ // Do not acquire a lock on this (am) in such cases, as it
+ // could cause a potential deadlock, if and when watchdog
+ // is invoked due to unavailability of lock on am and it
+ // would prevent watchdog from killing system_server.
+ if (process == null) {
+ sb.append("Process: system_server\n");
+ return;
+ }
// Note: ProcessRecord 'process' is guarded by the service
// instance. (notably process.pkgList, which could otherwise change
// concurrently during execution of this method)
synchronized (this) {
- if (process == null || process.pid == MY_PID) {
+ if (process.pid == MY_PID) {
sb.append("Process: system_server\n");
} else {
sb.append("Process: ").append(process.processName).append("\n");
}
- if (process == null) {
- return;
- }
int flags = process.info.flags;
IPackageManager pm = AppGlobals.getPackageManager();
sb.append("Flags: 0x").append(Integer.toString(flags, 16)).append("\n");