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

66 lines
2.2 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
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;
2022-03-02 20:59:20 +00:00
/* compiled from: DeferredScalarSubscriber.java */
/* loaded from: classes3.dex */
2021-06-27 20:44:35 +00:00
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
2022-03-02 20:59:20 +00:00
/* compiled from: DeferredScalarSubscriber.java */
2021-11-08 18:25:28 +00:00
/* renamed from: j0.l.a.a$a reason: collision with other inner class name */
2022-03-02 20:59:20 +00:00
/* loaded from: classes3.dex */
2022-03-30 16:43:10 +00:00
public static final class C0395a implements Producer {
2021-12-17 22:03:14 +00:00
public final a<?, ?> j;
2021-06-27 20:44:35 +00:00
2022-03-30 16:43:10 +00:00
public C0395a(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);
2022-03-02 20:59:20 +00:00
int i = (j > 0L ? 1 : (j == 0L ? 0 : -1));
2021-06-27 20:44:35 +00:00
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)) {
2022-03-02 20:59:20 +00:00
subscriber.onNext((R) 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) {
producer.j(RecyclerView.FOREVER_NS);
2021-06-27 20:44:35 +00:00
}
}