void (@NlsContexts.ProgressText @Nullable String reason) { synchronized (myLock) { if (mySuspended || myClosed) return; mySuspended = true; myTempReason = reason; ((ProgressManagerImpl)ProgressManager.getInstance()).addCheckCanceledHook(myHook); } myPublisher.suspendedStatusChanged(this); // Give running NonBlockingReadActions a chance to suspend ApplicationManager.getApplication().invokeLater(() -> WriteAction.run(() -> {})); }