It is actually quite tricky to lock-free swap a concurrently-accessed reference counted pointer. The reference count is not associated with the pointer, but with the pointee, so a 2CAS is not enough.
Typically you need hazard pointers or similar deferred reclamation tricks.
Typically you need hazard pointers or similar deferred reclamation tricks.