Avoid defer in lock.