guard pointer swap with an atomic