jimu-decompiled/sources/com/google/android/gms/tasks/zzr.java
2025-05-13 19:24:51 +02:00

43 lines
1.0 KiB
Java

package com.google.android.gms.tasks;
import java.util.ArrayDeque;
import java.util.Queue;
/* loaded from: classes.dex */
final class zzr<TResult> {
private final Object a = new Object();
private Queue<zzq<TResult>> b;
private boolean c;
zzr() {
}
public final void a(zzq<TResult> zzqVar) {
synchronized (this.a) {
if (this.b == null) {
this.b = new ArrayDeque();
}
this.b.add(zzqVar);
}
}
public final void a(Task<TResult> task) {
zzq<TResult> poll;
synchronized (this.a) {
if (this.b != null && !this.c) {
this.c = true;
while (true) {
synchronized (this.a) {
poll = this.b.poll();
if (poll == null) {
this.c = false;
return;
}
}
poll.a(task);
}
}
}
}
}