package o; import io.reactivex.rxjava3.exceptions.MissingBackpressureException; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicLong; import java.util.concurrent.atomic.AtomicReference; import o.AbstractC13173fSu; /* loaded from: classes6.dex */ public final class fUA extends AbstractC13155fSc { private long a; private AbstractC13173fSu b; private TimeUnit d; private long e; public fUA(long j, long j2, TimeUnit timeUnit, AbstractC13173fSu abstractC13173fSu) { this.a = j; this.e = j2; this.d = timeUnit; this.b = abstractC13173fSu; } @Override // o.AbstractC13155fSc public final void c(InterfaceC15338gnn interfaceC15338gnn) { IeS ieS = new IeS(interfaceC15338gnn); interfaceC15338gnn.c(ieS); AbstractC13173fSu abstractC13173fSu = this.b; if (abstractC13173fSu instanceof fYE) { AbstractC13173fSu.Sts c = abstractC13173fSu.c(); EnumC13192fTf.a(ieS.b, c); c.a(ieS, this.a, this.e, this.d); } else { EnumC13192fTf.a(ieS.b, abstractC13173fSu.d(ieS, this.a, this.e, this.d)); } } /* loaded from: classes6.dex */ static final class IeS extends AtomicLong implements InterfaceC15337gnm, Runnable { private InterfaceC15338gnn a; final AtomicReference b = new AtomicReference<>(); private long e; IeS(InterfaceC15338gnn interfaceC15338gnn) { this.a = interfaceC15338gnn; } @Override // o.InterfaceC15337gnm public final void c(long j) { if (fYC.e(j)) { fYK.c(this, j); } } @Override // o.InterfaceC15337gnm public final void a() { EnumC13192fTf.e(this.b); } @Override // java.lang.Runnable public final void run() { if (this.b.get() != EnumC13192fTf.DISPOSED) { if (get() != 0) { InterfaceC15338gnn interfaceC15338gnn = this.a; long j = this.e; this.e = j + 1; interfaceC15338gnn.onNext(Long.valueOf(j)); fYK.b(this, 1L); return; } InterfaceC15338gnn interfaceC15338gnn2 = this.a; StringBuilder sb = new StringBuilder("Could not emit value "); sb.append(this.e); sb.append(" due to lack of requests"); interfaceC15338gnn2.onError(new MissingBackpressureException(sb.toString())); EnumC13192fTf.e(this.b); } } } }