function exec(task) {
  try {
    suspend()
    task()
  } finally {
    release()
  }
}
Executes a task 'atomically'. Tasks scheduled during this execution will be queued
  and flushed after this task has finished (assuming the scheduler endup in a released
  state).