Avoid sync race condition.