Is ReferenceCountedObjectPtr <> assignment atomic?

Consider:

struct Obj : public ReferenceCountedObject {
  typedef ReferenceCountedObjectPtr <Obj> Ptr;
};

Obj::Ptr ptr = new Obj;

void thread1 ()
{
  ptr = new Obj;
}

Ptr  thread2 ()
{
  return ptr;
}

Is the assignment in thread1 atomic? By this, I mean will thread2 always either get the old Obj or the new Obj, with no leaks and no exceptions?

Well, that’s the idea!

I’ve been looking into this. here are my questions with regard to the Move ctor/assignment functions:

    /** Takes-over the object from another pointer. */
    ReferenceCountedObjectPtr (ReferenceCountedObjectPtr&& other) noexcept
        : referencedObject (other.referencedObject)  //doesn't use swapping
    {
        other.referencedObject = nullptr;
    }

    /** Takes-over the object from another pointer. */
    ReferenceCountedObjectPtr& operator= (ReferenceCountedObjectPtr&& other) noexcept
    {
        std::swap (referencedObject, other.referencedObject); //uses swapping
        return *this;
    }

referencedObject is a raw pointer, so is there anything preventing some torn read/writes on this raw pointer when you use move semantics?