@Override public void onComplete() { if (once.compareAndSet(false, true)) { for (NonoSubscription ns : subscribers.getAndSet(TERMINATED)) { ns.doComplete(); } } }
@Override public void onError(Throwable t) { if (once.compareAndSet(false, true)) { if (t == null) { t = new NullPointerException(); } error = t; for (NonoSubscription ns : subscribers.getAndSet(TERMINATED)) { ns.doError(t); } } else { RxJavaPlugins.onError(t); } }
@Override protected void subscribeActual(Subscriber<? super Void> s) { NonoSubscription ns = new NonoSubscription(s, this); s.onSubscribe(ns); if (add(ns)) { if (ns.get() != 0) { delete(ns); } } else { Throwable ex = error; if (ex != null) { ns.doError(ex); } else { ns.doComplete(); } } }
@Override protected void subscribeActual(Subscriber<? super Void> s) { NonoSubscription ns = new NonoSubscription(s, this); s.onSubscribe(ns); if (add(ns)) { if (ns.get() != 0) { delete(ns); } } else { Throwable ex = error; if (ex != null) { ns.doError(ex); } else { ns.doComplete(); } } }
@Override public void onError(Throwable t) { if (once.compareAndSet(false, true)) { if (t == null) { t = new NullPointerException(); } error = t; for (NonoSubscription ns : subscribers.getAndSet(TERMINATED)) { ns.doError(t); } } else { RxJavaPlugins.onError(t); } }
void doComplete() { if (compareAndSet(0, 1)) { downstream.onComplete(); } } }
void doError(Throwable t) { if (compareAndSet(0, 1)) { downstream.onError(t); } }
@Override public void cancel() { if (compareAndSet(0, 1)) { parent.delete(this); } }
void doComplete() { if (compareAndSet(0, 1)) { downstream.onComplete(); } } }
@Override public void cancel() { if (compareAndSet(0, 1)) { parent.delete(this); } }
void doError(Throwable t) { if (compareAndSet(0, 1)) { downstream.onError(t); } }
@Override public void onComplete() { if (once.compareAndSet(false, true)) { for (NonoSubscription ns : subscribers.getAndSet(TERMINATED)) { ns.doComplete(); } } }