221 lines
6.9 KiB
Java
221 lines
6.9 KiB
Java
package o;
|
|
|
|
import java.util.concurrent.atomic.AtomicBoolean;
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
import java.util.concurrent.atomic.AtomicReference;
|
|
|
|
/* renamed from: o.fXK, reason: case insensitive filesystem */
|
|
/* loaded from: classes6.dex */
|
|
public final class C13320fXK<T, B> extends fUX<T, AbstractC13163fSk<T>> {
|
|
private int b;
|
|
private InterfaceC13169fSq<B> d;
|
|
|
|
public C13320fXK(InterfaceC13169fSq<T> interfaceC13169fSq, InterfaceC13169fSq<B> interfaceC13169fSq2, int i) {
|
|
super(interfaceC13169fSq);
|
|
this.d = interfaceC13169fSq2;
|
|
this.b = i;
|
|
}
|
|
|
|
@Override // o.AbstractC13163fSk
|
|
public final void subscribeActual(InterfaceC13174fSv<? super AbstractC13163fSk<T>> interfaceC13174fSv) {
|
|
HBt hBt = new HBt(interfaceC13174fSv, this.b);
|
|
interfaceC13174fSv.onSubscribe(hBt);
|
|
this.d.subscribe(hBt.c);
|
|
this.c.subscribe(hBt);
|
|
}
|
|
|
|
/* renamed from: o.fXK$HBt */
|
|
/* loaded from: classes6.dex */
|
|
static final class HBt<T, B> extends AtomicInteger implements InterfaceC13174fSv<T>, fSJ, Runnable {
|
|
static final Object a = new Object();
|
|
volatile boolean e;
|
|
private InterfaceC13174fSv<? super AbstractC13163fSk<T>> f;
|
|
private int i;
|
|
private C13423fZz<T> j;
|
|
final IeS<T, B> c = new IeS<>(this);
|
|
final AtomicReference<fSJ> g = new AtomicReference<>();
|
|
private AtomicInteger k = new AtomicInteger(1);
|
|
final C13378fYq<Object> d = new C13378fYq<>();
|
|
final C13355fYI b = new C13355fYI();
|
|
private AtomicBoolean h = new AtomicBoolean();
|
|
|
|
HBt(InterfaceC13174fSv<? super AbstractC13163fSk<T>> interfaceC13174fSv, int i) {
|
|
this.f = interfaceC13174fSv;
|
|
this.i = i;
|
|
}
|
|
|
|
@Override // o.InterfaceC13174fSv
|
|
public final void onSubscribe(fSJ fsj) {
|
|
if (EnumC13192fTf.a(this.g, fsj)) {
|
|
this.d.b(a);
|
|
b();
|
|
}
|
|
}
|
|
|
|
@Override // o.InterfaceC13174fSv
|
|
public final void onNext(T t) {
|
|
this.d.b(t);
|
|
b();
|
|
}
|
|
|
|
@Override // o.InterfaceC13174fSv
|
|
public final void onError(Throwable th) {
|
|
this.c.dispose();
|
|
if (fYR.c(this.b, th)) {
|
|
this.e = true;
|
|
b();
|
|
} else {
|
|
C13418fZu.c(th);
|
|
}
|
|
}
|
|
|
|
@Override // o.InterfaceC13174fSv
|
|
public final void onComplete() {
|
|
this.c.dispose();
|
|
this.e = true;
|
|
b();
|
|
}
|
|
|
|
@Override // o.fSJ
|
|
public final void dispose() {
|
|
if (this.h.compareAndSet(false, true)) {
|
|
this.c.dispose();
|
|
if (this.k.decrementAndGet() == 0) {
|
|
EnumC13192fTf.e(this.g);
|
|
}
|
|
}
|
|
}
|
|
|
|
@Override // o.fSJ
|
|
public final boolean isDisposed() {
|
|
return this.h.get();
|
|
}
|
|
|
|
@Override // java.lang.Runnable
|
|
public final void run() {
|
|
if (this.k.decrementAndGet() == 0) {
|
|
EnumC13192fTf.e(this.g);
|
|
}
|
|
}
|
|
|
|
/* JADX WARN: Multi-variable type inference failed */
|
|
final void b() {
|
|
if (getAndIncrement() != 0) {
|
|
return;
|
|
}
|
|
InterfaceC13174fSv<? super AbstractC13163fSk<T>> interfaceC13174fSv = this.f;
|
|
C13378fYq<Object> c13378fYq = this.d;
|
|
C13355fYI c13355fYI = this.b;
|
|
int i = 1;
|
|
while (this.k.get() != 0) {
|
|
C13423fZz<T> c13423fZz = this.j;
|
|
boolean z = this.e;
|
|
if (z && c13355fYI.get() != null) {
|
|
c13378fYq.e();
|
|
Throwable b = fYR.b(c13355fYI);
|
|
if (c13423fZz != 0) {
|
|
this.j = null;
|
|
c13423fZz.onError(b);
|
|
}
|
|
interfaceC13174fSv.onError(b);
|
|
return;
|
|
}
|
|
Object b2 = c13378fYq.b();
|
|
boolean z2 = b2 == null;
|
|
if (z && z2) {
|
|
Throwable b3 = fYR.b(c13355fYI);
|
|
if (b3 == null) {
|
|
if (c13423fZz != 0) {
|
|
this.j = null;
|
|
c13423fZz.onComplete();
|
|
}
|
|
interfaceC13174fSv.onComplete();
|
|
return;
|
|
}
|
|
if (c13423fZz != 0) {
|
|
this.j = null;
|
|
c13423fZz.onError(b3);
|
|
}
|
|
interfaceC13174fSv.onError(b3);
|
|
return;
|
|
}
|
|
if (z2) {
|
|
i = addAndGet(-i);
|
|
if (i == 0) {
|
|
return;
|
|
}
|
|
} else if (b2 != a) {
|
|
c13423fZz.onNext(b2);
|
|
} else {
|
|
if (c13423fZz != 0) {
|
|
this.j = null;
|
|
c13423fZz.onComplete();
|
|
}
|
|
if (!this.h.get()) {
|
|
C13423fZz<T> b4 = C13423fZz.b(this.i, this);
|
|
this.j = b4;
|
|
this.k.getAndIncrement();
|
|
fXL fxl = new fXL(b4);
|
|
interfaceC13174fSv.onNext(fxl);
|
|
if (!fxl.b.get() && fxl.b.compareAndSet(false, true)) {
|
|
b4.onComplete();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
c13378fYq.e();
|
|
this.j = null;
|
|
}
|
|
}
|
|
|
|
/* renamed from: o.fXK$IeS */
|
|
/* loaded from: classes6.dex */
|
|
static final class IeS<T, B> extends AbstractC13403fZf<B> {
|
|
private HBt<T, B> c;
|
|
private boolean d;
|
|
|
|
IeS(HBt<T, B> hBt) {
|
|
this.c = hBt;
|
|
}
|
|
|
|
@Override // o.InterfaceC13174fSv
|
|
public final void onNext(B b) {
|
|
if (this.d) {
|
|
return;
|
|
}
|
|
HBt<T, B> hBt = this.c;
|
|
hBt.d.b(HBt.a);
|
|
hBt.b();
|
|
}
|
|
|
|
@Override // o.InterfaceC13174fSv
|
|
public final void onError(Throwable th) {
|
|
if (this.d) {
|
|
C13418fZu.c(th);
|
|
return;
|
|
}
|
|
this.d = true;
|
|
HBt<T, B> hBt = this.c;
|
|
EnumC13192fTf.e(hBt.g);
|
|
if (fYR.c(hBt.b, th)) {
|
|
hBt.e = true;
|
|
hBt.b();
|
|
} else {
|
|
C13418fZu.c(th);
|
|
}
|
|
}
|
|
|
|
@Override // o.InterfaceC13174fSv
|
|
public final void onComplete() {
|
|
if (this.d) {
|
|
return;
|
|
}
|
|
this.d = true;
|
|
HBt<T, B> hBt = this.c;
|
|
EnumC13192fTf.e(hBt.g);
|
|
hBt.e = true;
|
|
hBt.b();
|
|
}
|
|
}
|
|
}
|