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

53 lines
1.4 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;
/* compiled from: DeferredScalarSubscriberSafe */
public abstract class b<T, R> extends a<T, R> {
public boolean m;
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() {
if (!this.m) {
this.m = true;
if (this.j) {
2021-11-08 18:25:28 +00:00
R r = this.k;
2021-06-27 20:44:35 +00:00
Subscriber<? super R> subscriber = this.i;
do {
int i = this.l.get();
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();
}
this.l.lazySet(3);
return;
}
2021-11-08 18:25:28 +00:00
this.k = r;
2021-06-27 20:44:35 +00:00
} else {
return;
}
} while (!this.l.compareAndSet(0, 2));
return;
}
this.i.onCompleted();
}
}
2021-11-08 18:25:28 +00:00
@Override // j0.g
2021-06-27 20:44:35 +00:00
public void onError(Throwable th) {
if (!this.m) {
this.m = true;
this.k = null;
this.i.onError(th);
return;
}
l.b(th);
}
}