void (@NotNull PsiFile file) { // use this contrived form to be able to bail out immediately by modifying toSleepMs in the other thread while (toSleepMs.addAndGet(-100) > 0) { TimeoutUtil.sleep(100); } }