32 #ifndef _QORE_QOREREFERENCECOUNTER_H
34 #define _QORE_QOREREFERENCECOUNTER_H
37 #include <qore/macros.h>
44 mutable int references;
45 #ifndef HAVE_ATOMIC_MACROS
70 return references == 1;
84 #endif // _QORE_QOREREFERENCECOUNTER_H
DLLEXPORT bool ROdereference() const
atomically decrements the reference count
QoreThreadLock mRO
pthread lock to ensure atomicity of updates for architectures where we don't have an atomic increment...
Definition: QoreReferenceCounter.h:47
DLLEXPORT void ROreference() const
atomically increments the reference count
DLLLOCAL int reference_count() const
gets the reference count
Definition: QoreReferenceCounter.h:61
provides atomic reference counting to Qore objects
Definition: QoreReferenceCounter.h:42
DLLLOCAL bool is_unique() const
returns true if the reference count is 1
Definition: QoreReferenceCounter.h:69
provides a mutually-exclusive thread lock
Definition: QoreThreadLock.h:49
DLLEXPORT ~QoreReferenceCounter()
destroys the reference counter object
DLLEXPORT QoreReferenceCounter()
creates the reference counter object