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

182 lines
5.2 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
/* renamed from: o.fXe, reason: case insensitive filesystem */
/* loaded from: classes6.dex */
public final class C13331fXe<T> extends fUX<T, T> {
private InterfaceC13169fSq<?> b;
private boolean e;
public C13331fXe(InterfaceC13169fSq<T> interfaceC13169fSq, InterfaceC13169fSq<?> interfaceC13169fSq2, boolean z) {
super(interfaceC13169fSq);
this.b = interfaceC13169fSq2;
this.e = z;
}
@Override // o.AbstractC13163fSk
public final void subscribeActual(InterfaceC13174fSv<? super T> interfaceC13174fSv) {
C13406fZi c13406fZi = new C13406fZi(interfaceC13174fSv);
if (this.e) {
this.c.subscribe(new RVV(c13406fZi, this.b));
} else {
this.c.subscribe(new Sts(c13406fZi, this.b));
}
}
/* renamed from: o.fXe$HBt */
/* loaded from: classes6.dex */
static abstract class HBt<T> extends AtomicReference<T> implements InterfaceC13174fSv<T>, fSJ {
private InterfaceC13169fSq<?> b;
fSJ c;
final InterfaceC13174fSv<? super T> d;
final AtomicReference<fSJ> e = new AtomicReference<>();
abstract void a();
abstract void b();
HBt(InterfaceC13174fSv<? super T> interfaceC13174fSv, InterfaceC13169fSq<?> interfaceC13169fSq) {
this.d = interfaceC13174fSv;
this.b = interfaceC13169fSq;
}
@Override // o.InterfaceC13174fSv
public void onSubscribe(fSJ fsj) {
if (EnumC13192fTf.d(this.c, fsj)) {
this.c = fsj;
this.d.onSubscribe(this);
if (this.e.get() == null) {
this.b.subscribe(new IeS(this));
}
}
}
@Override // o.InterfaceC13174fSv
public void onNext(T t) {
lazySet(t);
}
@Override // o.InterfaceC13174fSv
public void onError(Throwable th) {
EnumC13192fTf.e(this.e);
this.d.onError(th);
}
@Override // o.InterfaceC13174fSv
public void onComplete() {
EnumC13192fTf.e(this.e);
b();
}
@Override // o.fSJ
public void dispose() {
EnumC13192fTf.e(this.e);
this.c.dispose();
}
@Override // o.fSJ
public boolean isDisposed() {
return this.e.get() == EnumC13192fTf.DISPOSED;
}
}
/* renamed from: o.fXe$IeS */
/* loaded from: classes6.dex */
static final class IeS<T> implements InterfaceC13174fSv<Object> {
private HBt<T> c;
IeS(HBt<T> hBt) {
this.c = hBt;
}
@Override // o.InterfaceC13174fSv
public final void onSubscribe(fSJ fsj) {
EnumC13192fTf.a(this.c.e, fsj);
}
@Override // o.InterfaceC13174fSv
public final void onNext(Object obj) {
this.c.a();
}
@Override // o.InterfaceC13174fSv
public final void onError(Throwable th) {
HBt<T> hBt = this.c;
hBt.c.dispose();
hBt.d.onError(th);
}
@Override // o.InterfaceC13174fSv
public final void onComplete() {
HBt<T> hBt = this.c;
hBt.c.dispose();
hBt.b();
}
}
/* renamed from: o.fXe$Sts */
/* loaded from: classes6.dex */
static final class Sts<T> extends HBt<T> {
Sts(InterfaceC13174fSv<? super T> interfaceC13174fSv, InterfaceC13169fSq<?> interfaceC13169fSq) {
super(interfaceC13174fSv, interfaceC13169fSq);
}
@Override // o.C13331fXe.HBt
final void b() {
this.d.onComplete();
}
@Override // o.C13331fXe.HBt
final void a() {
T andSet = getAndSet(null);
if (andSet != null) {
this.d.onNext(andSet);
}
}
}
/* renamed from: o.fXe$RVV */
/* loaded from: classes6.dex */
static final class RVV<T> extends HBt<T> {
private volatile boolean a;
private AtomicInteger b;
RVV(InterfaceC13174fSv<? super T> interfaceC13174fSv, InterfaceC13169fSq<?> interfaceC13169fSq) {
super(interfaceC13174fSv, interfaceC13169fSq);
this.b = new AtomicInteger();
}
@Override // o.C13331fXe.HBt
final void b() {
this.a = true;
if (this.b.getAndIncrement() == 0) {
T andSet = getAndSet(null);
if (andSet != null) {
this.d.onNext(andSet);
}
this.d.onComplete();
}
}
@Override // o.C13331fXe.HBt
final void a() {
if (this.b.getAndIncrement() != 0) {
return;
}
do {
boolean z = this.a;
T andSet = getAndSet(null);
if (andSet != null) {
this.d.onNext(andSet);
}
if (z) {
this.d.onComplete();
return;
}
} while (this.b.decrementAndGet() != 0);
}
}
}