43 lines
1.0 KiB
Java
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);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|