void (@NotNull Runnable process, @Nullable ProgressIndicator progress) { if (progress != null) { assertNoOtherThreadUnder(progress); } executeProcessUnderProgress(() -> { try { try { if (progress != null && !progress.isRunning()) { progress.start(); } } catch (RuntimeException e) { throw e; } catch (Throwable e) { throw new RuntimeException(e); } process.run(); } finally { if (progress != null && progress.isRunning()) { progress.stop(); if (progress instanceof ProgressIndicatorEx) { ((ProgressIndicatorEx)progress).processFinish(); } } } }, progress); }