private void tryKillProcess() {
    ProgressManager.getInstance().executeNonCancelableSection(() -> {
      myHandler.destroyProcess();
    });

    if (ApplicationManager.getApplication().isReadAccessAllowed() ||
        shouldSuppressReadLocks()) {
      // Some Git operations are called while holding the global locks.
      // Ex: access to the 'GitIndexVirtualFile' or 'GitDirectoryVirtualFile'.
      // In this case, we should not delay the current thread cancellation.
      ApplicationManager.getApplication().executeOnPooledThread(() -> {
        waitAndHardKillProcess();
      });
    }
    else {
      ProgressManager.getInstance().executeNonCancelableSection(() -> {
        waitAndHardKillProcess();
      });
    }
  }
private void tryKillProcess()