package com.google.android.gms.tasks; import java.util.ArrayDeque; import java.util.Queue; /* loaded from: classes.dex */ final class zzr { private final Object a = new Object(); private Queue> b; private boolean c; zzr() { } public final void a(zzq zzqVar) { synchronized (this.a) { if (this.b == null) { this.b = new ArrayDeque(); } this.b.add(zzqVar); } } public final void a(Task task) { zzq 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); } } } } }