void (@Nullable Project project, @NotNull Runnable action) { if (!shouldReport() || DebugAttachDetector.isDebugEnabled() || ApplicationManager.getApplication().isUnitTestMode()) { action.run(); return; } final ModalityState initial = ModalityState.current(); ALARM.cancelAllRequests(); ALARM.addRequest(() -> dumpThreads(project, initial), MAX_ALLOWED_TIME); try { action.run(); } finally { ALARM.cancelAllRequests(); } }