void () { if (myHandler != null) { while (!myHandler.waitFor(WAIT_TIMEOUT_MS)) { try { ProgressManager.checkCanceled(); } catch (ProcessCanceledException pce) { ProgressManager.getInstance().executeNonCancelableSection(() -> { if (!tryKill()) { LOG.warn("Could not terminate [" + printableCommandLine() + "]."); } }); throw pce; } } } }