Merge "Fix potential race condition due to missing lock" am: 8787386e84 am: af33aac24e am: a8c0e350fe
Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1864979 Change-Id: If8c420e6daf779940c9e700796e1594eb4bc96ec
This commit is contained in:
@@ -4906,7 +4906,9 @@ public final class ActiveServices {
|
|||||||
sr.setProcess(null, null, 0, null);
|
sr.setProcess(null, null, 0, null);
|
||||||
sr.isolatedProc = null;
|
sr.isolatedProc = null;
|
||||||
sr.executeNesting = 0;
|
sr.executeNesting = 0;
|
||||||
sr.forceClearTracker();
|
synchronized (mAm.mProcessStats.mLock) {
|
||||||
|
sr.forceClearTracker();
|
||||||
|
}
|
||||||
if (mDestroyingServices.remove(sr)) {
|
if (mDestroyingServices.remove(sr)) {
|
||||||
if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "killServices remove destroying " + sr);
|
if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "killServices remove destroying " + sr);
|
||||||
}
|
}
|
||||||
@@ -5056,7 +5058,9 @@ public final class ActiveServices {
|
|||||||
i--;
|
i--;
|
||||||
ServiceRecord sr = mDestroyingServices.get(i);
|
ServiceRecord sr = mDestroyingServices.get(i);
|
||||||
if (sr.app == app) {
|
if (sr.app == app) {
|
||||||
sr.forceClearTracker();
|
synchronized (mAm.mProcessStats.mLock) {
|
||||||
|
sr.forceClearTracker();
|
||||||
|
}
|
||||||
mDestroyingServices.remove(i);
|
mDestroyingServices.remove(i);
|
||||||
if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "killServices remove destroying " + sr);
|
if (DEBUG_SERVICE) Slog.v(TAG_SERVICE, "killServices remove destroying " + sr);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user