diff options
author | Christopher Tate <ctate@google.com> | 2011-04-04 16:59:21 -0700 |
---|---|---|
committer | Christopher Tate <ctate@google.com> | 2011-04-04 16:59:21 -0700 |
commit | 4559764e9f8adadcc80c825fb5dafd3dfb739bcf (patch) | |
tree | b519a74bea7154901575cddce97661db59ee620f /services | |
parent | 78a9f6a8227d1e9b465acb84f8476a30c5af9c13 (diff) | |
download | frameworks_base-4559764e9f8adadcc80c825fb5dafd3dfb739bcf.zip frameworks_base-4559764e9f8adadcc80c825fb5dafd3dfb739bcf.tar.gz frameworks_base-4559764e9f8adadcc80c825fb5dafd3dfb739bcf.tar.bz2 |
Fix deadlock in BackupManagerService
Lock ordering bug. The fix is to avoid having to hold both locks
simultaneously in one prong of the deadlock. (Further strengthening:
the code path for potentially acquiring both simultaneously now
begins at a common method, ensuring that lock ordering is always
consistent.)
Change-Id: If9433aff8326fec2ba0e97e96ad2d835b01e2cda
Diffstat (limited to 'services')
-rw-r--r-- | services/java/com/android/server/BackupManagerService.java | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/services/java/com/android/server/BackupManagerService.java b/services/java/com/android/server/BackupManagerService.java index ea38fbb..6e76331 100644 --- a/services/java/com/android/server/BackupManagerService.java +++ b/services/java/com/android/server/BackupManagerService.java @@ -760,15 +760,15 @@ class BackupManagerService extends IBackupManager.Stub { sf.delete(); } } + } - // Enqueue a new backup of every participant - int N = mBackupParticipants.size(); - for (int i=0; i<N; i++) { - int uid = mBackupParticipants.keyAt(i); - HashSet<ApplicationInfo> participants = mBackupParticipants.valueAt(i); - for (ApplicationInfo app: participants) { - dataChangedImpl(app.packageName); - } + // Enqueue a new backup of every participant + int N = mBackupParticipants.size(); + for (int i=0; i<N; i++) { + int uid = mBackupParticipants.keyAt(i); + HashSet<ApplicationInfo> participants = mBackupParticipants.valueAt(i); + for (ApplicationInfo app: participants) { + dataChangedImpl(app.packageName); } } } |