code: private static boolean acquireAnalysisPermitUnlessCancelled(IProgressMonitor monitor) throws InterruptedException {
          do {
              if (analysisSem.tryAcquire(1, TimeUnit.SECONDS)) {
                  return true;
              }
          } while (!monitor.isCanceled());
  
          return false;
      }
docs: Acquires an analysis permit unless first cancelled.
  
  @return {@code true} if permit has been acquired, {@code false} if
  cancellation was observed and permit has not been acquired