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

54 lines
1.4 KiB
Java

package j0.l.a;
import rx.Subscriber;
import rx.Subscription;
import rx.subscriptions.CompositeSubscription;
/* compiled from: OnSubscribeRefCount */
public class a0 extends Subscriber<T> {
public final /* synthetic */ Subscriber i;
public final /* synthetic */ CompositeSubscription j;
public final /* synthetic */ c0 k;
/* JADX INFO: super call moved to the top of the method (can break code semantics) */
public a0(c0 c0Var, Subscriber subscriber, Subscriber subscriber2, CompositeSubscription compositeSubscription) {
super(subscriber);
this.k = c0Var;
this.i = subscriber2;
this.j = compositeSubscription;
}
public void a() {
this.k.l.lock();
try {
if (this.k.j == this.j) {
Object obj = this.k.i;
if (obj instanceof Subscription) {
((Subscription) obj).unsubscribe();
}
this.k.j.unsubscribe();
this.k.j = new CompositeSubscription();
this.k.k.set(0);
}
} finally {
this.k.l.unlock();
}
}
@Override // j0.g
public void onCompleted() {
a();
this.i.onCompleted();
}
@Override // j0.g
public void onError(Throwable th) {
a();
this.i.onError(th);
}
@Override // j0.g
public void onNext(T t) {
this.i.onNext(t);
}
}