package o; /* loaded from: classes6.dex */ public abstract class fTV extends C13228fUg implements InterfaceC13174fSv, InterfaceC13361fYY { public final InterfaceC13174fSv a; public volatile boolean b; public final InterfaceC13408fZk d; public volatile boolean e; private Throwable i; @Override // o.InterfaceC13361fYY public void a(InterfaceC13174fSv interfaceC13174fSv, U u) { } public fTV(InterfaceC13174fSv interfaceC13174fSv, InterfaceC13408fZk interfaceC13408fZk) { this.a = interfaceC13174fSv; this.d = interfaceC13408fZk; } /* JADX INFO: Access modifiers changed from: protected */ public final void a(U u, fSJ fsj) { InterfaceC13174fSv interfaceC13174fSv = this.a; InterfaceC13408fZk interfaceC13408fZk = this.d; if (this.c.get() == 0 && this.c.compareAndSet(0, 1)) { a(interfaceC13174fSv, (InterfaceC13174fSv) u); if (this.c.addAndGet(-1) == 0) { return; } } else { interfaceC13408fZk.b(u); if (this.c.getAndIncrement() != 0) { return; } } C13360fYU.e(interfaceC13408fZk, interfaceC13174fSv, false, fsj, this); } public final void c(U u, fSJ fsj) { InterfaceC13174fSv interfaceC13174fSv = this.a; InterfaceC13408fZk interfaceC13408fZk = this.d; if (this.c.get() == 0 && this.c.compareAndSet(0, 1)) { if (interfaceC13408fZk.c()) { a(interfaceC13174fSv, (InterfaceC13174fSv) u); if (this.c.addAndGet(-1) == 0) { return; } } else { interfaceC13408fZk.b(u); } } else { interfaceC13408fZk.b(u); if (this.c.getAndIncrement() != 0) { return; } } C13360fYU.e(interfaceC13408fZk, interfaceC13174fSv, false, fsj, this); } @Override // o.InterfaceC13361fYY public final int e(int i) { return this.c.addAndGet(i); } @Override // o.InterfaceC13361fYY public final Throwable b() { return this.i; } @Override // o.InterfaceC13361fYY public final boolean d() { return this.e; } @Override // o.InterfaceC13361fYY public final boolean a() { return this.b; } }