152 lines
5.2 KiB
Java
152 lines
5.2 KiB
Java
package j0.l.a;
|
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
|
import b.i.a.f.e.o.f;
|
|
import j0.a;
|
|
import j0.l.e.c;
|
|
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;
|
|
/* compiled from: OperatorOnBackpressureBuffer.java */
|
|
/* loaded from: classes3.dex */
|
|
public class a1<T> implements Observable.b<T, T> {
|
|
public final a.b j = a.C0392a.a;
|
|
|
|
/* compiled from: OperatorOnBackpressureBuffer.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class a<T> extends Subscriber<T> implements c.a {
|
|
public final Subscriber<? super T> l;
|
|
public final a.b p;
|
|
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);
|
|
|
|
public a(Subscriber<? super T> subscriber, Long l, Action0 action0, a.b bVar) {
|
|
this.l = subscriber;
|
|
this.p = bVar;
|
|
}
|
|
|
|
@Override // j0.g
|
|
public void onCompleted() {
|
|
if (!this.m.get()) {
|
|
c cVar = this.n;
|
|
cVar.terminated = true;
|
|
cVar.a();
|
|
}
|
|
}
|
|
|
|
@Override // j0.g
|
|
public void onError(Throwable th) {
|
|
if (!this.m.get()) {
|
|
c cVar = this.n;
|
|
if (!cVar.terminated) {
|
|
cVar.exception = th;
|
|
cVar.terminated = true;
|
|
cVar.a();
|
|
}
|
|
}
|
|
}
|
|
|
|
/* 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] */
|
|
@Override // j0.g
|
|
/*
|
|
Code decompiled incorrectly, please refer to instructions dump.
|
|
*/
|
|
public void onNext(T t) {
|
|
long j;
|
|
boolean z2;
|
|
Action0 action0;
|
|
boolean z3 = false;
|
|
if (this.k == null) {
|
|
z3 = true;
|
|
} else {
|
|
do {
|
|
j = this.k.get();
|
|
if (j <= 0) {
|
|
try {
|
|
} catch (MissingBackpressureException e) {
|
|
if (this.m.compareAndSet(false, true)) {
|
|
unsubscribe();
|
|
this.l.onError(e);
|
|
}
|
|
}
|
|
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;
|
|
}
|
|
}
|
|
}
|
|
z2 = false;
|
|
action0 = this.o;
|
|
if (action0 != null) {
|
|
}
|
|
if (!z2) {
|
|
}
|
|
}
|
|
} while (!this.k.compareAndSet(j, j - 1));
|
|
z3 = true;
|
|
}
|
|
if (z3) {
|
|
ConcurrentLinkedQueue<Object> concurrentLinkedQueue = this.j;
|
|
if (t == null) {
|
|
t = (T) e.f3753b;
|
|
}
|
|
concurrentLinkedQueue.offer(t);
|
|
this.n.a();
|
|
}
|
|
}
|
|
|
|
@Override // rx.Subscriber
|
|
public void onStart() {
|
|
request(RecyclerView.FOREVER_NS);
|
|
}
|
|
}
|
|
|
|
/* compiled from: OperatorOnBackpressureBuffer.java */
|
|
/* loaded from: classes3.dex */
|
|
public static final class b {
|
|
public static final a1<?> a = new a1<>();
|
|
}
|
|
|
|
public a1() {
|
|
int i = j0.a.a;
|
|
}
|
|
|
|
@Override // j0.k.b
|
|
public Object call(Object obj) {
|
|
Subscriber subscriber = (Subscriber) obj;
|
|
a aVar = new a(subscriber, null, null, this.j);
|
|
subscriber.add(aVar);
|
|
subscriber.setProducer(aVar.n);
|
|
return aVar;
|
|
}
|
|
}
|