66 while (orig_ptr != old_ptr) {
77 #endif // HAVE_THREADS
79 if (ptr != (To *)NULL) {
81 #ifdef DO_MEMORY_USAGE
82 if (MemoryUsage::get_track_memory_usage()) {
89 if (old_ptr != (To *)NULL) {
90 unref_delete(old_ptr);
102 reassign((To *)copy._void_ptr);
105 #ifdef DO_MEMORY_USAGE
119 type = get_type_handle(To);
122 MemoryUsage::update_type(ptr, type);
125 #endif // DO_MEMORY_USAGE
137 reassign((To *)NULL);
150 if (_void_ptr != (
void *)NULL) {
151 out <<
":" << ((To *)_void_ptr)->get_ref_count();
static Pointer get_ptr(const Pointer &var)
Atomically retrieves the snapshot value of the indicated variable.
static TypeHandle none()
Returns a special zero-valued TypeHandle that is used to indicate no type.
void clear()
A convenient way to set the ThreadSafePointerTo object to NULL.
void output(ostream &out) const
A handy function to output ThreadSafePointerTo's as a hex pointer followed by a reference count...
This is the base class for ThreadSafePointerTo and ThreadSafeConstPointerTo.
TypeHandle is the identifier used to differentiate C++ class types.
static Pointer compare_and_exchange_ptr(Pointer &mem, Pointer old_value, Pointer new_value)
Atomic compare and exchange.