discord-jadx/app/src/main/java/j0/l/a/a1.java

152 lines
5.2 KiB
Java
Raw Normal View History

2021-11-08 18:25:28 +00:00
package j0.l.a;
2021-06-27 20:44:35 +00:00
import androidx.recyclerview.widget.RecyclerView;
2022-01-27 00:50:41 +00:00
import b.i.a.f.e.o.f;
2021-11-08 18:25:28 +00:00
import j0.a;
import j0.l.e.c;
2021-06-27 20:44:35 +00:00
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import rx.Observable;
import rx.Subscriber;
import rx.exceptions.MissingBackpressureException;
import rx.functions.Action0;
2022-03-02 20:59:20 +00:00
/* compiled from: OperatorOnBackpressureBuffer.java */
/* loaded from: classes3.dex */
2021-06-27 20:44:35 +00:00
public class a1<T> implements Observable.b<T, T> {
2022-03-30 16:43:10 +00:00
public final a.b j = a.C0392a.a;
2021-06-27 20:44:35 +00:00
2022-03-02 20:59:20 +00:00
/* compiled from: OperatorOnBackpressureBuffer.java */
/* loaded from: classes3.dex */
2021-06-27 20:44:35 +00:00
public static final class a<T> extends Subscriber<T> implements c.a {
2021-12-17 22:03:14 +00:00
public final Subscriber<? super T> l;
public final a.b p;
2022-03-02 20:59:20 +00:00
public final ConcurrentLinkedQueue<Object> j = new ConcurrentLinkedQueue<>();
public final AtomicBoolean m = new AtomicBoolean(false);
public final AtomicLong k = null;
public final Action0 o = null;
public final c n = new c(this);
2021-06-27 20:44:35 +00:00
public a(Subscriber<? super T> subscriber, Long l, Action0 action0, a.b bVar) {
2021-12-17 22:03:14 +00:00
this.l = subscriber;
this.p = bVar;
2021-06-27 20:44:35 +00:00
}
2021-11-08 18:25:28 +00:00
@Override // j0.g
2021-06-27 20:44:35 +00:00
public void onCompleted() {
2021-12-17 22:03:14 +00:00
if (!this.m.get()) {
c cVar = this.n;
2021-06-27 20:44:35 +00:00
cVar.terminated = true;
cVar.a();
}
}
2021-11-08 18:25:28 +00:00
@Override // j0.g
2021-06-27 20:44:35 +00:00
public void onError(Throwable th) {
2021-12-17 22:03:14 +00:00
if (!this.m.get()) {
c cVar = this.n;
2021-06-27 20:44:35 +00:00
if (!cVar.terminated) {
cVar.exception = th;
cVar.terminated = true;
cVar.a();
}
}
}
2022-03-02 20:59:20 +00:00
/* JADX WARN: Removed duplicated region for block: B:39:0x0045 A[EXC_TOP_SPLITTER, SYNTHETIC] */
/* JADX WARN: Removed duplicated region for block: B:42:0x006b A[EDGE_INSN: B:42:0x006b->B:30:0x006b ?: BREAK , SYNTHETIC] */
2021-11-08 18:25:28 +00:00
@Override // j0.g
2022-03-02 20:59:20 +00:00
/*
Code decompiled incorrectly, please refer to instructions dump.
*/
2021-06-27 20:44:35 +00:00
public void onNext(T t) {
2022-03-02 20:59:20 +00:00
long j;
2021-06-27 20:44:35 +00:00
boolean z2;
Action0 action0;
boolean z3 = false;
2022-03-02 20:59:20 +00:00
if (this.k == null) {
z3 = true;
} else {
do {
j = this.k.get();
2021-06-27 20:44:35 +00:00
if (j <= 0) {
try {
} catch (MissingBackpressureException e) {
2021-12-17 22:03:14 +00:00
if (this.m.compareAndSet(false, true)) {
2021-06-27 20:44:35 +00:00
unsubscribe();
2021-12-17 22:03:14 +00:00
this.l.onError(e);
2021-06-27 20:44:35 +00:00
}
}
2022-03-02 20:59:20 +00:00
if (this.p.a()) {
Object poll = this.j.poll();
AtomicLong atomicLong = this.k;
if (!(atomicLong == null || poll == null)) {
atomicLong.incrementAndGet();
}
if (poll != null) {
z2 = true;
action0 = this.o;
if (action0 != null) {
try {
action0.call();
} catch (Throwable th) {
f.o1(th);
c cVar = this.n;
if (!cVar.terminated) {
cVar.exception = th;
cVar.terminated = true;
cVar.a();
}
}
}
if (!z2) {
break;
}
}
}
2021-06-27 20:44:35 +00:00
z2 = false;
2021-12-17 22:03:14 +00:00
action0 = this.o;
2021-06-27 20:44:35 +00:00
if (action0 != null) {
}
if (!z2) {
}
}
2022-03-02 20:59:20 +00:00
} while (!this.k.compareAndSet(j, j - 1));
2021-06-27 20:44:35 +00:00
z3 = true;
}
if (z3) {
2021-12-17 22:03:14 +00:00
ConcurrentLinkedQueue<Object> concurrentLinkedQueue = this.j;
2021-06-27 20:44:35 +00:00
if (t == null) {
2022-03-30 16:43:10 +00:00
t = (T) e.f3753b;
2021-06-27 20:44:35 +00:00
}
concurrentLinkedQueue.offer(t);
2021-12-17 22:03:14 +00:00
this.n.a();
2021-06-27 20:44:35 +00:00
}
}
@Override // rx.Subscriber
public void onStart() {
request(RecyclerView.FOREVER_NS);
2021-06-27 20:44:35 +00:00
}
}
2022-03-02 20:59:20 +00:00
/* compiled from: OperatorOnBackpressureBuffer.java */
/* loaded from: classes3.dex */
2021-06-27 20:44:35 +00:00
public static final class b {
public static final a1<?> a = new a1<>();
}
public a1() {
2021-11-08 18:25:28 +00:00
int i = j0.a.a;
2021-06-27 20:44:35 +00:00
}
2021-11-08 18:25:28 +00:00
@Override // j0.k.b
2021-06-27 20:44:35 +00:00
public Object call(Object obj) {
Subscriber subscriber = (Subscriber) obj;
2021-12-17 22:03:14 +00:00
a aVar = new a(subscriber, null, null, this.j);
2021-06-27 20:44:35 +00:00
subscriber.add(aVar);
2021-12-17 22:03:14 +00:00
subscriber.setProducer(aVar.n);
2021-06-27 20:44:35 +00:00
return aVar;
}
}