try {
    return f();
  } finally {
    progress.reportProgressDone();