what-the-bank/sources/o/C13215fUF.java

131 lines
4.3 KiB
Java

package o;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
import o.AbstractC13173fSu;
/* renamed from: o.fUF, reason: case insensitive filesystem */
/* loaded from: classes6.dex */
public final class C13215fUF<T> extends AbstractC13240fUs<T, T> {
private AbstractC13173fSu a;
private boolean b;
public C13215fUF(AbstractC13155fSc<T> abstractC13155fSc, AbstractC13173fSu abstractC13173fSu, boolean z) {
super(abstractC13155fSc);
this.a = abstractC13173fSu;
this.b = true;
}
@Override // o.AbstractC13155fSc
public final void c(InterfaceC15338gnn<? super T> interfaceC15338gnn) {
AbstractC13173fSu.Sts c = this.a.c();
RVV rvv = new RVV(interfaceC15338gnn, c, this.e, this.b);
interfaceC15338gnn.c(rvv);
c.c(rvv);
}
/* renamed from: o.fUF$RVV */
/* loaded from: classes6.dex */
static final class RVV<T> extends AtomicReference<Thread> implements InterfaceC13158fSf<T>, InterfaceC15337gnm, Runnable {
private InterfaceC15338gnn<? super T> b;
private InterfaceC15340gnp<T> d;
private boolean e;
private AbstractC13173fSu.Sts h;
private AtomicReference<InterfaceC15337gnm> c = new AtomicReference<>();
private AtomicLong a = new AtomicLong();
RVV(InterfaceC15338gnn<? super T> interfaceC15338gnn, AbstractC13173fSu.Sts sts, InterfaceC15340gnp<T> interfaceC15340gnp, boolean z) {
this.b = interfaceC15338gnn;
this.h = sts;
this.d = interfaceC15340gnp;
this.e = !z;
}
@Override // java.lang.Runnable
public final void run() {
lazySet(Thread.currentThread());
InterfaceC15340gnp<T> interfaceC15340gnp = this.d;
this.d = null;
interfaceC15340gnp.a(this);
}
@Override // o.InterfaceC13158fSf, o.InterfaceC15338gnn
public final void c(InterfaceC15337gnm interfaceC15337gnm) {
if (fYC.c(this.c, interfaceC15337gnm)) {
long andSet = this.a.getAndSet(0L);
if (andSet != 0) {
d(andSet, interfaceC15337gnm);
}
}
}
@Override // o.InterfaceC15338gnn
public final void onNext(T t) {
this.b.onNext(t);
}
@Override // o.InterfaceC15338gnn
public final void onError(Throwable th) {
this.b.onError(th);
this.h.dispose();
}
@Override // o.InterfaceC15338gnn
public final void onComplete() {
this.b.onComplete();
this.h.dispose();
}
@Override // o.InterfaceC15337gnm
public final void c(long j) {
if (fYC.e(j)) {
InterfaceC15337gnm interfaceC15337gnm = this.c.get();
if (interfaceC15337gnm != null) {
d(j, interfaceC15337gnm);
return;
}
fYK.c(this.a, j);
InterfaceC15337gnm interfaceC15337gnm2 = this.c.get();
if (interfaceC15337gnm2 != null) {
long andSet = this.a.getAndSet(0L);
if (andSet != 0) {
d(andSet, interfaceC15337gnm2);
}
}
}
}
private void d(long j, InterfaceC15337gnm interfaceC15337gnm) {
if (this.e || Thread.currentThread() == get()) {
interfaceC15337gnm.c(j);
} else {
this.h.c(new HBt(interfaceC15337gnm, j));
}
}
@Override // o.InterfaceC15337gnm
public final void a() {
fYC.c(this.c);
this.h.dispose();
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: o.fUF$RVV$HBt */
/* loaded from: classes6.dex */
public static final class HBt implements Runnable {
private InterfaceC15337gnm b;
private long e;
HBt(InterfaceC15337gnm interfaceC15337gnm, long j) {
this.b = interfaceC15337gnm;
this.e = j;
}
@Override // java.lang.Runnable
public final void run() {
this.b.c(this.e);
}
}
}
}