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

54 lines
1.5 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
2021-11-08 18:25:28 +00:00
import j0.o.l;
2021-06-27 20:44:35 +00:00
import rx.Subscriber;
2022-03-02 20:59:20 +00:00
/* compiled from: DeferredScalarSubscriberSafe.java */
/* loaded from: classes3.dex */
2021-06-27 20:44:35 +00:00
public abstract class b<T, R> extends a<T, R> {
2021-12-17 22:03:14 +00:00
public boolean n;
2021-06-27 20:44:35 +00:00
public b(Subscriber<? super R> subscriber) {
super(subscriber);
}
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.n) {
this.n = true;
if (this.k) {
R r = this.l;
Subscriber<? super R> subscriber = this.j;
2021-06-27 20:44:35 +00:00
do {
2021-12-17 22:03:14 +00:00
int i = this.m.get();
2021-06-27 20:44:35 +00:00
if (i != 2 && i != 3 && !subscriber.isUnsubscribed()) {
if (i == 1) {
2021-11-08 18:25:28 +00:00
subscriber.onNext(r);
2021-06-27 20:44:35 +00:00
if (!subscriber.isUnsubscribed()) {
subscriber.onCompleted();
}
2021-12-17 22:03:14 +00:00
this.m.lazySet(3);
2021-06-27 20:44:35 +00:00
return;
}
2021-12-17 22:03:14 +00:00
this.l = r;
2021-06-27 20:44:35 +00:00
} else {
return;
}
2021-12-17 22:03:14 +00:00
} while (!this.m.compareAndSet(0, 2));
2021-06-27 20:44:35 +00:00
return;
}
2021-12-17 22:03:14 +00:00
this.j.onCompleted();
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 onError(Throwable th) {
2021-12-17 22:03:14 +00:00
if (!this.n) {
this.n = true;
this.l = null;
this.j.onError(th);
2021-06-27 20:44:35 +00:00
return;
}
l.b(th);
}
}