code: public boolean cancel(int timeout, TimeUnit timeoutUnit) throws InterruptedException {
          if (isCanceled()) {
              return true;
          }
  
          cancelLatch.countDown();
  
          try {
              return doneLatch.await(timeout, timeoutUnit);
          } finally {
              new DefaultCurrentProcess().infanticide();
          }
      }
docs: Cancel build and wait for build session done
  
  @return {@code true} if the build session is done and {@code false}
  if time out happens