Merge "Two REMOVE_PROVIDER messages caused by race condition."
This commit is contained in:
@@ -4492,6 +4492,8 @@ public final class ActivityThread {
|
|||||||
+ "snatched provider from the jaws of death");
|
+ "snatched provider from the jaws of death");
|
||||||
}
|
}
|
||||||
prc.removePending = false;
|
prc.removePending = false;
|
||||||
|
// There is a race! It fails to remove the message, which
|
||||||
|
// will be handled in completeRemoveProvider().
|
||||||
mH.removeMessages(H.REMOVE_PROVIDER, prc);
|
mH.removeMessages(H.REMOVE_PROVIDER, prc);
|
||||||
} else {
|
} else {
|
||||||
unstableDelta = 0;
|
unstableDelta = 0;
|
||||||
@@ -4671,6 +4673,11 @@ public final class ActivityThread {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// More complicated race!! Some client managed to acquire the
|
||||||
|
// provider and release it before the removal was completed.
|
||||||
|
// Continue the removal, and abort the next remove message.
|
||||||
|
prc.removePending = false;
|
||||||
|
|
||||||
final IBinder jBinder = prc.holder.provider.asBinder();
|
final IBinder jBinder = prc.holder.provider.asBinder();
|
||||||
ProviderRefCount existingPrc = mProviderRefCountMap.get(jBinder);
|
ProviderRefCount existingPrc = mProviderRefCountMap.get(jBinder);
|
||||||
if (existingPrc == prc) {
|
if (existingPrc == prc) {
|
||||||
|
|||||||
Reference in New Issue
Block a user