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

565 lines
19 KiB
Java
Raw Permalink Normal View History

2024-07-27 18:17:47 +07:00
package o;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicReference;
import o.AbstractC13173fSu;
/* renamed from: o.fXQ, reason: case insensitive filesystem */
/* loaded from: classes6.dex */
public final class C13321fXQ<T> extends fUX<T, AbstractC13163fSk<T>> {
private AbstractC13173fSu a;
private boolean b;
private int d;
private long e;
private TimeUnit g;
private long i;
private long j;
public C13321fXQ(AbstractC13163fSk<T> abstractC13163fSk, long j, long j2, TimeUnit timeUnit, AbstractC13173fSu abstractC13173fSu, long j3, int i, boolean z) {
super(abstractC13163fSk);
this.i = j;
this.j = j2;
this.g = timeUnit;
this.a = abstractC13173fSu;
this.e = j3;
this.d = i;
this.b = z;
}
@Override // o.AbstractC13163fSk
public final void subscribeActual(InterfaceC13174fSv<? super AbstractC13163fSk<T>> interfaceC13174fSv) {
if (this.i != this.j) {
this.c.subscribe(new LWm(interfaceC13174fSv, this.i, this.j, this.g, this.a.c(), this.d));
} else if (this.e == Long.MAX_VALUE) {
this.c.subscribe(new IeS(interfaceC13174fSv, this.i, this.g, this.a, this.d));
} else {
this.c.subscribe(new HBt(interfaceC13174fSv, this.i, this.g, this.a, this.d, this.e, this.b));
}
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: o.fXQ$RVV */
/* loaded from: classes6.dex */
public static abstract class RVV<T> extends AtomicInteger implements InterfaceC13174fSv<T>, fSJ {
volatile boolean a;
final InterfaceC13174fSv<? super AbstractC13163fSk<T>> c;
final int d;
long e;
final TimeUnit f;
volatile boolean g;
Throwable h;
final long j;
private fSJ l;
final InterfaceC13408fZk<Object> i = new C13378fYq();
final AtomicBoolean b = new AtomicBoolean();
final AtomicInteger m = new AtomicInteger(1);
abstract void a();
abstract void c();
abstract void e();
RVV(InterfaceC13174fSv<? super AbstractC13163fSk<T>> interfaceC13174fSv, long j, TimeUnit timeUnit, int i) {
this.c = interfaceC13174fSv;
this.j = j;
this.f = timeUnit;
this.d = i;
}
@Override // o.InterfaceC13174fSv
public final void onSubscribe(fSJ fsj) {
if (EnumC13192fTf.d(this.l, fsj)) {
this.l = fsj;
this.c.onSubscribe(this);
c();
}
}
@Override // o.InterfaceC13174fSv
public final void onNext(T t) {
this.i.b(t);
e();
}
@Override // o.InterfaceC13174fSv
public final void onError(Throwable th) {
this.h = th;
this.a = true;
e();
}
@Override // o.InterfaceC13174fSv
public final void onComplete() {
this.a = true;
e();
}
@Override // o.fSJ
public final void dispose() {
if (this.b.compareAndSet(false, true)) {
b();
}
}
@Override // o.fSJ
public final boolean isDisposed() {
return this.b.get();
}
final void b() {
if (this.m.decrementAndGet() == 0) {
a();
this.l.dispose();
this.g = true;
e();
}
}
}
/* renamed from: o.fXQ$IeS */
/* loaded from: classes6.dex */
static final class IeS<T> extends RVV<T> implements Runnable {
private static Object l = new Object();
private C13197fTk k;
private AbstractC13173fSu n;
/* renamed from: o, reason: collision with root package name */
private C13423fZz<T> f9124o;
private Runnable t;
IeS(InterfaceC13174fSv<? super AbstractC13163fSk<T>> interfaceC13174fSv, long j, TimeUnit timeUnit, AbstractC13173fSu abstractC13173fSu, int i) {
super(interfaceC13174fSv, j, timeUnit, i);
this.n = abstractC13173fSu;
this.k = new C13197fTk();
this.t = new RunnableC0115IeS(this);
}
@Override // o.C13321fXQ.RVV
final void c() {
if (this.b.get()) {
return;
}
this.m.getAndIncrement();
this.f9124o = C13423fZz.b(this.d, this.t);
this.e = 1L;
fXL fxl = new fXL(this.f9124o);
this.c.onNext(fxl);
EnumC13192fTf.c(this.k, this.n.d(this, this.j, this.j, this.f));
if (fxl.b.get() || !fxl.b.compareAndSet(false, true)) {
return;
}
this.f9124o.onComplete();
}
@Override // java.lang.Runnable
public final void run() {
this.i.b(l);
e();
}
/* JADX WARN: Multi-variable type inference failed */
/* JADX WARN: Type inference failed for: r2v12, types: [o.fZz] */
@Override // o.C13321fXQ.RVV
final void e() {
if (getAndIncrement() != 0) {
return;
}
InterfaceC13408fZk<Object> interfaceC13408fZk = this.i;
InterfaceC13174fSv<? super AbstractC13163fSk<T>> interfaceC13174fSv = this.c;
C13423fZz c13423fZz = (C13423fZz<T>) this.f9124o;
int i = 1;
while (true) {
if (this.g) {
interfaceC13408fZk.e();
this.f9124o = null;
c13423fZz = (C13423fZz<T>) null;
} else {
boolean z = this.a;
Object b = interfaceC13408fZk.b();
boolean z2 = b == null;
if (z && z2) {
Throwable th = this.h;
if (th != null) {
if (c13423fZz != null) {
c13423fZz.onError(th);
}
interfaceC13174fSv.onError(th);
} else {
if (c13423fZz != null) {
c13423fZz.onComplete();
}
interfaceC13174fSv.onComplete();
}
this.k.dispose();
this.g = true;
} else if (!z2) {
if (b == l) {
if (c13423fZz != null) {
c13423fZz.onComplete();
this.f9124o = null;
c13423fZz = (C13423fZz<T>) null;
}
if (this.b.get()) {
this.k.dispose();
} else {
this.e++;
this.m.getAndIncrement();
c13423fZz = (C13423fZz<T>) C13423fZz.b(this.d, this.t);
this.f9124o = c13423fZz;
fXL fxl = new fXL(c13423fZz);
interfaceC13174fSv.onNext(fxl);
if (!fxl.b.get() && fxl.b.compareAndSet(false, true)) {
c13423fZz.onComplete();
}
}
} else if (c13423fZz != null) {
c13423fZz.onNext(b);
}
}
}
i = addAndGet(-i);
if (i == 0) {
return;
}
}
}
@Override // o.C13321fXQ.RVV
final void a() {
this.k.dispose();
}
/* renamed from: o.fXQ$IeS$IeS, reason: collision with other inner class name */
/* loaded from: classes6.dex */
final class RunnableC0115IeS implements Runnable {
private IeS e;
RunnableC0115IeS(IeS ieS) {
this.e = ieS;
}
@Override // java.lang.Runnable
public final void run() {
this.e.b();
}
}
}
/* renamed from: o.fXQ$HBt */
/* loaded from: classes6.dex */
static final class HBt<T> extends RVV<T> implements Runnable {
private AbstractC13173fSu k;
private long l;
private long n;
/* renamed from: o, reason: collision with root package name */
private boolean f9123o;
private C13423fZz<T> p;
private C13197fTk q;
private AbstractC13173fSu.Sts s;
HBt(InterfaceC13174fSv<? super AbstractC13163fSk<T>> interfaceC13174fSv, long j, TimeUnit timeUnit, AbstractC13173fSu abstractC13173fSu, int i, long j2, boolean z) {
super(interfaceC13174fSv, j, timeUnit, i);
this.k = abstractC13173fSu;
this.n = j2;
this.f9123o = z;
this.s = z ? abstractC13173fSu.c() : null;
this.q = new C13197fTk();
}
@Override // o.C13321fXQ.RVV
final void c() {
if (this.b.get()) {
return;
}
this.e = 1L;
this.m.getAndIncrement();
this.p = C13423fZz.b(this.d, this);
fXL fxl = new fXL(this.p);
this.c.onNext(fxl);
RVV rvv = new RVV(this, 1L);
if (this.f9123o) {
EnumC13192fTf.c(this.q, this.s.a(rvv, this.j, this.j, this.f));
} else {
EnumC13192fTf.c(this.q, this.k.d(rvv, this.j, this.j, this.f));
}
if (fxl.b.get() || !fxl.b.compareAndSet(false, true)) {
return;
}
this.p.onComplete();
}
@Override // java.lang.Runnable
public final void run() {
b();
}
@Override // o.C13321fXQ.RVV
final void a() {
this.q.dispose();
AbstractC13173fSu.Sts sts = this.s;
if (sts != null) {
sts.dispose();
}
}
/* JADX WARN: Multi-variable type inference failed */
@Override // o.C13321fXQ.RVV
final void e() {
if (getAndIncrement() != 0) {
return;
}
InterfaceC13408fZk<Object> interfaceC13408fZk = this.i;
InterfaceC13174fSv<? super AbstractC13163fSk<T>> interfaceC13174fSv = this.c;
C13423fZz<T> c13423fZz = this.p;
int i = 1;
while (true) {
if (this.g) {
interfaceC13408fZk.e();
c13423fZz = 0;
this.p = null;
} else {
boolean z = this.a;
Object b = interfaceC13408fZk.b();
boolean z2 = b == null;
if (z && z2) {
Throwable th = this.h;
if (th != null) {
if (c13423fZz != 0) {
c13423fZz.onError(th);
}
interfaceC13174fSv.onError(th);
} else {
if (c13423fZz != 0) {
c13423fZz.onComplete();
}
interfaceC13174fSv.onComplete();
}
this.q.dispose();
AbstractC13173fSu.Sts sts = this.s;
if (sts != null) {
sts.dispose();
}
this.g = true;
} else if (!z2) {
if (b instanceof RVV) {
if (((RVV) b).c == this.e || !this.f9123o) {
this.l = 0L;
c13423fZz = d(c13423fZz);
}
} else if (c13423fZz != 0) {
c13423fZz.onNext(b);
long j = this.l + 1;
if (j == this.n) {
this.l = 0L;
c13423fZz = d(c13423fZz);
} else {
this.l = j;
}
}
}
}
i = addAndGet(-i);
if (i == 0) {
return;
}
}
}
private C13423fZz<T> d(C13423fZz<T> c13423fZz) {
if (c13423fZz != null) {
c13423fZz.onComplete();
c13423fZz = null;
}
if (!this.b.get()) {
long j = this.e + 1;
this.e = j;
this.m.getAndIncrement();
c13423fZz = C13423fZz.b(this.d, this);
this.p = c13423fZz;
fXL fxl = new fXL(c13423fZz);
this.c.onNext(fxl);
if (this.f9123o) {
EnumC13192fTf.d((AtomicReference<fSJ>) this.q, this.s.a(new RVV(this, j), this.j, this.j, this.f));
}
if (!fxl.b.get() && fxl.b.compareAndSet(false, true)) {
c13423fZz.onComplete();
}
} else {
this.q.dispose();
AbstractC13173fSu.Sts sts = this.s;
if (sts != null) {
sts.dispose();
}
}
return c13423fZz;
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: o.fXQ$HBt$RVV */
/* loaded from: classes6.dex */
public static final class RVV implements Runnable {
final long c;
private HBt<?> e;
RVV(HBt<?> hBt, long j) {
this.e = hBt;
this.c = j;
}
@Override // java.lang.Runnable
public final void run() {
HBt<?> hBt = this.e;
hBt.i.b(this);
hBt.e();
}
}
}
/* renamed from: o.fXQ$LWm */
/* loaded from: classes6.dex */
static final class LWm<T> extends RVV<T> implements Runnable {
private List<C13423fZz<T>> n;
/* renamed from: o, reason: collision with root package name */
private long f9125o;
private AbstractC13173fSu.Sts t;
static final Object l = new Object();
static final Object k = new Object();
LWm(InterfaceC13174fSv<? super AbstractC13163fSk<T>> interfaceC13174fSv, long j, long j2, TimeUnit timeUnit, AbstractC13173fSu.Sts sts, int i) {
super(interfaceC13174fSv, j, timeUnit, i);
this.f9125o = j2;
this.t = sts;
this.n = new LinkedList();
}
@Override // o.C13321fXQ.RVV
final void c() {
if (this.b.get()) {
return;
}
this.e = 1L;
this.m.getAndIncrement();
C13423fZz<T> b = C13423fZz.b(this.d, this);
this.n.add(b);
fXL fxl = new fXL(b);
this.c.onNext(fxl);
this.t.a(new HBt(this, false), this.j, this.f);
AbstractC13173fSu.Sts sts = this.t;
HBt hBt = new HBt(this, true);
long j = this.f9125o;
sts.a(hBt, j, j, this.f);
if (fxl.b.get() || !fxl.b.compareAndSet(false, true)) {
return;
}
b.onComplete();
this.n.remove(b);
}
@Override // o.C13321fXQ.RVV
final void a() {
this.t.dispose();
}
/* JADX WARN: Multi-variable type inference failed */
@Override // o.C13321fXQ.RVV
final void e() {
if (getAndIncrement() != 0) {
return;
}
InterfaceC13408fZk<Object> interfaceC13408fZk = this.i;
InterfaceC13174fSv<? super AbstractC13163fSk<T>> interfaceC13174fSv = this.c;
List<C13423fZz<T>> list = this.n;
int i = 1;
while (true) {
if (this.g) {
interfaceC13408fZk.e();
list.clear();
} else {
boolean z = this.a;
Object b = interfaceC13408fZk.b();
boolean z2 = b == null;
if (z && z2) {
Throwable th = this.h;
if (th != null) {
Iterator<C13423fZz<T>> it = list.iterator();
while (it.hasNext()) {
it.next().onError(th);
}
interfaceC13174fSv.onError(th);
} else {
Iterator<C13423fZz<T>> it2 = list.iterator();
while (it2.hasNext()) {
it2.next().onComplete();
}
interfaceC13174fSv.onComplete();
}
this.t.dispose();
this.g = true;
} else if (!z2) {
if (b == l) {
if (!this.b.get()) {
this.e++;
this.m.getAndIncrement();
C13423fZz<T> b2 = C13423fZz.b(this.d, this);
list.add(b2);
fXL fxl = new fXL(b2);
interfaceC13174fSv.onNext(fxl);
this.t.a(new HBt(this, false), this.j, this.f);
if (!fxl.b.get() && fxl.b.compareAndSet(false, true)) {
b2.onComplete();
}
}
} else if (b == k) {
if (!list.isEmpty()) {
list.remove(0).onComplete();
}
} else {
Iterator<C13423fZz<T>> it3 = list.iterator();
while (it3.hasNext()) {
it3.next().onNext(b);
}
}
}
}
i = addAndGet(-i);
if (i == 0) {
return;
}
}
}
@Override // java.lang.Runnable
public final void run() {
b();
}
/* JADX INFO: Access modifiers changed from: package-private */
/* renamed from: o.fXQ$LWm$HBt */
/* loaded from: classes6.dex */
public static final class HBt implements Runnable {
private boolean d;
private LWm<?> e;
HBt(LWm<?> lWm, boolean z) {
this.e = lWm;
this.d = z;
}
@Override // java.lang.Runnable
public final void run() {
LWm<?> lWm = this.e;
lWm.i.b(this.d ? LWm.l : LWm.k);
lWm.e();
}
}
}
}