private long closeTimeoutThreadPool()

in src/main/java/com/aliyun/openservices/aliyun/log/producer/LogProducer.java [504:516]


  private long closeTimeoutThreadPool(long timeoutMs)
      throws InterruptedException, ProducerException {
    long startMs = System.currentTimeMillis();
    timeoutThreadPool.shutdown();
    if (timeoutThreadPool.awaitTermination(timeoutMs, TimeUnit.MILLISECONDS)) {
      LOGGER.debug("The timeoutThreadPool is terminated");
    } else {
      LOGGER.warn("The timeoutThreadPool is not fully terminated");
      throw new ProducerException("the timeoutThreadPool is not fully terminated");
    }
    long nowMs = System.currentTimeMillis();
    return Math.max(0, timeoutMs - nowMs + startMs);
  }