void (Runnable runnable, CompletionProcess process) { if (ourIsInBatchUpdate.get().booleanValue() || !(process instanceof CompletionProgressIndicator)) { runnable.run(); return; } try { ourIsInBatchUpdate.set(Boolean.TRUE); runnable.run(); ProgressManager.checkCanceled(); CompletionProgressIndicator currentIndicator = (CompletionProgressIndicator)process; CompletionThreadingBase threading = Objects.requireNonNull(currentIndicator.getCompletionThreading()); threading.flushBatchResult(currentIndicator); } finally { ourIsInBatchUpdate.set(Boolean.FALSE); } }