private void queueSession(RefreshSessionImpl session, ModalityState modality) {
    if (LOG.isDebugEnabled()) LOG.debug("Queue session with id=" + session.hashCode());
    if (session.isEventSession()) {
      processEvents(session, session.getModality(), runRefreshSession(session, -1L));
    }
    else {
      var queuedAt = System.nanoTime();
      myQueue.execute(() -> {
        var timeInQueue = NANOSECONDS.toMillis(System.nanoTime() - queuedAt);
        startIndicator(IdeCoreBundle.message("file.synchronize.progress"));
        var events = new AtomicReference<Collection<VFileEvent>>();
        try {
          var title = IdeCoreBundle.message("progress.title.doing.file.refresh.0", session);
          HeavyProcessLatch.INSTANCE.performOperation(HeavyProcessLatch.Type.Syncing, title, () -> events.set(runRefreshSession(session, timeInQueue)));
        }
        finally {
          stopIndicator();
          processEvents(session, modality, events.get());
        }
      });
    }
    myEventCounter.eventHappened(session);
  }
private void queueSession(RefreshSessionImpl session, ModalityState modality)