private static void awaitWithCheckCancelled(Phaser phaser, int phase) throws InterruptedException {
    while (true) {
      ProgressManager.checkCanceled();
      try {
        phaser.awaitAdvanceInterruptibly(phase, 100, TimeUnit.MILLISECONDS);
        break;
      }
      catch (TimeoutException ignored) {
      }
    }
  }
private static void awaitWithCheckCancelled(Phaser phaser, int phase)