void (@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(true); int i = 0; while (!myCanceled && !myEvaluated) { indicator.checkCanceled(); indicator.setFraction(((i++) % 100) * 0.01); mySemaphore.waitFor(300); } }