@Test public void testTwo() { holder.init(2).cancel(); }
@Override public void cancel() { if (cancelledUpdater.compareAndSet(this, 0, 1)) { Throwable t = null; for (Cancellable other : others) { try { if (other != null) { other.cancel(); } } catch (Throwable tt) { if (t == null) { t = tt; } else { t.addSuppressed(tt); } } } if (t != null) { throwException(t); } } }
CompositeCancellable implements Cancellable { @Override public void cancel() { if (cancelledUpdater.compareAndSet(this, 0, 1)) { Throwable t = null; for (Cancellable other : others) { try { if (other != null) { other.cancel(); } } catch (Throwable tt) { if (t == null) { t = tt; } else { t.addSuppressed(tt); } } } if (t != null) { throwException(t); } } } }
CompositeCancellable implements Cancellable { @Override public void cancel() { if (cancelledUpdater.compareAndSet(this, 0, 1)) { Throwable t = null; for (Cancellable other : others) { try { if (other != null) { other.cancel(); } } catch (Throwable tt) { if (t == null) { t = tt; } else { t.addSuppressed(tt); } } } if (t != null) { throwException(t); } } } private  CompositeCancellable(Cancellable... others); }
CompositeCancellable implements Cancellable { @Override public void cancel() { if (cancelledUpdater.compareAndSet(this, 0, 1)) { Throwable t = null; for (Cancellable other : others) { try { if (other != null) { other.cancel(); } } catch (Throwable tt) { if (t == null) { t = tt; } else { t.addSuppressed(tt); } } } if (t != null) { throwException(t); } } } private  CompositeCancellable(Cancellable... others); @Override void cancel(); }
CompositeCancellable implements Cancellable { @Override public void cancel() { if (cancelledUpdater.compareAndSet(this, 0, 1)) { Throwable t = null; for (Cancellable other : others) { try { if (other != null) { other.cancel(); } } catch (Throwable tt) { if (t == null) { t = tt; } else { t.addSuppressed(tt); } } } if (t != null) { throwException(t); } } } private  CompositeCancellable(Cancellable... others); @Override void cancel();  }