AggregateFuture.java 文件源码

java
阅读 42 收藏 0 点赞 0 评论 0

项目:codebuff 作者:
@CanIgnoreReturnValue
@Override
public final boolean cancel(boolean mayInterruptIfRunning) {
  // Must get a reference to the futures before we cancel, as they'll be cleared out.
  RunningState localRunningState = runningState;
  ImmutableCollection<? extends ListenableFuture<? extends InputT>> futures = (localRunningState != null) ? localRunningState.futures : null;
  // Cancel all the component futures.
  boolean cancelled = super.cancel(mayInterruptIfRunning);
  // & is faster than the branch required for &&
  if (cancelled & futures != null) {
    for (ListenableFuture<?> future : futures) {
      future.cancel(mayInterruptIfRunning);
    }
  }
  return cancelled;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号