void () { try { started.setResult(null); long startedAt = System.currentTimeMillis(); while (10000 > System.currentTimeMillis() - startedAt) ProgressManager.checkCanceled(); infinite = true; } finally { finished.setResult(null); } }