53 lines
1.4 KiB
Java
53 lines
1.4 KiB
Java
|
package j0.l.a;
|
||
|
|
||
|
import j0.o.l;
|
||
|
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);
|
||
|
}
|
||
|
|
||
|
@Override // j0.g
|
||
|
public void onCompleted() {
|
||
|
if (!this.m) {
|
||
|
this.m = true;
|
||
|
if (this.j) {
|
||
|
R r = this.k;
|
||
|
Subscriber<? super R> subscriber = this.i;
|
||
|
do {
|
||
|
int i = this.l.get();
|
||
|
if (i != 2 && i != 3 && !subscriber.isUnsubscribed()) {
|
||
|
if (i == 1) {
|
||
|
subscriber.onNext(r);
|
||
|
if (!subscriber.isUnsubscribed()) {
|
||
|
subscriber.onCompleted();
|
||
|
}
|
||
|
this.l.lazySet(3);
|
||
|
return;
|
||
|
}
|
||
|
this.k = r;
|
||
|
} else {
|
||
|
return;
|
||
|
}
|
||
|
} while (!this.l.compareAndSet(0, 2));
|
||
|
return;
|
||
|
}
|
||
|
this.i.onCompleted();
|
||
|
}
|
||
|
}
|
||
|
|
||
|
@Override // j0.g
|
||
|
public void onError(Throwable th) {
|
||
|
if (!this.m) {
|
||
|
this.m = true;
|
||
|
this.k = null;
|
||
|
this.i.onError(th);
|
||
|
return;
|
||
|
}
|
||
|
l.b(th);
|
||
|
}
|
||
|
}
|