2021-11-08 18:25:28 +00:00
|
|
|
package j0.l.a;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2021-08-09 22:50:01 +00:00
|
|
|
import androidx.recyclerview.widget.RecyclerView;
|
2021-06-27 20:44:35 +00:00
|
|
|
import java.util.Objects;
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
import rx.Producer;
|
|
|
|
import rx.Subscriber;
|
|
|
|
/* compiled from: DeferredScalarSubscriber */
|
|
|
|
public abstract class a<T, R> extends Subscriber<T> {
|
2021-12-17 22:03:14 +00:00
|
|
|
public final Subscriber<? super R> j;
|
|
|
|
public boolean k;
|
|
|
|
public R l;
|
|
|
|
public final AtomicInteger m = new AtomicInteger();
|
2021-06-27 20:44:35 +00:00
|
|
|
|
|
|
|
/* compiled from: DeferredScalarSubscriber */
|
2021-11-08 18:25:28 +00:00
|
|
|
/* renamed from: j0.l.a.a$a reason: collision with other inner class name */
|
2022-02-01 19:18:35 +00:00
|
|
|
public static final class C0321a implements Producer {
|
2021-12-17 22:03:14 +00:00
|
|
|
public final a<?, ?> j;
|
2021-06-27 20:44:35 +00:00
|
|
|
|
2022-02-01 19:18:35 +00:00
|
|
|
public C0321a(a<?, ?> aVar) {
|
2021-12-17 22:03:14 +00:00
|
|
|
this.j = aVar;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // rx.Producer
|
|
|
|
public void j(long j) {
|
2021-12-17 22:03:14 +00:00
|
|
|
a<?, ?> aVar = this.j;
|
2021-06-27 20:44:35 +00:00
|
|
|
Objects.requireNonNull(aVar);
|
|
|
|
int i = (j > 0 ? 1 : (j == 0 ? 0 : -1));
|
|
|
|
if (i < 0) {
|
2021-12-21 23:37:30 +00:00
|
|
|
throw new IllegalArgumentException(b.d.b.a.a.s("n >= 0 required but it was ", j));
|
2021-06-27 20:44:35 +00:00
|
|
|
} else if (i != 0) {
|
2021-12-17 22:03:14 +00:00
|
|
|
Subscriber<? super Object> subscriber = aVar.j;
|
2021-06-27 20:44:35 +00:00
|
|
|
do {
|
2021-12-17 22:03:14 +00:00
|
|
|
int i2 = aVar.m.get();
|
2021-06-27 20:44:35 +00:00
|
|
|
if (i2 != 1 && i2 != 3 && !subscriber.isUnsubscribed()) {
|
|
|
|
if (i2 == 2) {
|
2021-12-17 22:03:14 +00:00
|
|
|
if (aVar.m.compareAndSet(2, 3)) {
|
|
|
|
subscriber.onNext(aVar.l);
|
2021-06-27 20:44:35 +00:00
|
|
|
if (!subscriber.isUnsubscribed()) {
|
|
|
|
subscriber.onCompleted();
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
return;
|
|
|
|
}
|
2021-12-17 22:03:14 +00:00
|
|
|
} while (!aVar.m.compareAndSet(0, 1));
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public a(Subscriber<? super R> subscriber) {
|
2021-12-17 22:03:14 +00:00
|
|
|
this.j = subscriber;
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
@Override // rx.Subscriber
|
|
|
|
public final void setProducer(Producer producer) {
|
2021-08-09 22:50:01 +00:00
|
|
|
producer.j(RecyclerView.FOREVER_NS);
|
2021-06-27 20:44:35 +00:00
|
|
|
}
|
|
|
|
}
|