Skip to content

Commit 3f13291

Browse files
authored
Fix synchronized wrong object while manipulating appColdStartSubscribers (#3992)
1 parent a50da9f commit 3f13291

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

firebase-perf/src/main/java/com/google/firebase/perf/application/AppStateMonitor.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ public void unregisterForAppState(WeakReference<AppStateCallback> subscriber) {
290290
* @param subscriber the {@link AppColdStartCallback} instance.
291291
*/
292292
public void registerForAppColdStart(AppColdStartCallback subscriber) {
293-
synchronized (appStateSubscribers) {
293+
synchronized (appColdStartSubscribers) {
294294
appColdStartSubscribers.add(subscriber);
295295
}
296296
}
@@ -315,7 +315,7 @@ private void updateAppState(ApplicationProcessState newState) {
315315

316316
/** Send cold start update to registered subscribers. */
317317
private void sendAppColdStartUpdate() {
318-
synchronized (appStateSubscribers) {
318+
synchronized (appColdStartSubscribers) {
319319
for (Iterator<AppColdStartCallback> i = appColdStartSubscribers.iterator(); i.hasNext(); ) {
320320
AppColdStartCallback callback = i.next();
321321
if (callback != null) {

0 commit comments

Comments
 (0)