discord-jadx/app/src/main/java/c/i/a/f/n/y.java

46 lines
1.2 KiB
Java

package c.i.a.f.n;
import androidx.annotation.NonNull;
import com.google.android.gms.tasks.Task;
import java.util.ArrayDeque;
import java.util.Queue;
/* compiled from: com.google.android.gms:play-services-tasks@@17.2.0 */
public final class y<TResult> {
public final Object a = new Object();
public Queue<z<TResult>> b;
/* renamed from: c reason: collision with root package name */
public boolean f1229c;
public final void a(@NonNull Task<TResult> task) {
z<TResult> poll;
synchronized (this.a) {
if (this.b != null) {
if (!this.f1229c) {
this.f1229c = true;
}
}
return;
}
while (true) {
synchronized (this.a) {
poll = this.b.poll();
if (poll == null) {
this.f1229c = false;
return;
}
}
poll.a(task);
}
}
public final void b(@NonNull z<TResult> zVar) {
synchronized (this.a) {
if (this.b == null) {
this.b = new ArrayDeque();
}
this.b.add(zVar);
}
}
}