Why do we need a lock here? The scheduler should ensure the task is only running once.