void () { myAllFilesAreProcessedLatch.countDown(); double newFraction = 1.0 - myAllFilesAreProcessedLatch.getCount() / (double) myTotalFiles; try { myIndicator.setFraction(newFraction); } catch (Exception ignored) { //Unexpected here. A misbehaved progress indicator must not break our code flow. } }