boolean awaitTermination(long timeout, @NotNull TimeUnit unit) throws InterruptedException {
    if (shutdownTrace.get() == null) {
      throw new IllegalStateException("must call shutdown before");
    }
    long deadline = System.nanoTime() + unit.toNanos(timeout);
    try {
      myPoisonPill.get(timeout, unit);
    }
    catch (ExecutionException e) {
      throw new RuntimeException(e);
    }
    catch (TimeoutException e) {
      return false;
    }
    transferThread.join(TimeUnit.NANOSECONDS.toMillis(Math.max(1, deadline - System.nanoTime())));
    return !transferThread.isAlive();
  }
boolean awaitTermination(long timeout, @NotNull TimeUnit unit)