24 #ifndef _QORE_QOREREFERENCECOUNTER_H
26 #define _QORE_QOREREFERENCECOUNTER_H
29 #include <qore/macros.h>
36 mutable int references;
37 #ifndef HAVE_ATOMIC_MACROS
62 return references == 1;
76 #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:39
DLLEXPORT void ROreference() const
atomically increments the reference count
DLLLOCAL int reference_count() const
gets the reference count
Definition: QoreReferenceCounter.h:53
provides atomic reference counting to Qore objects
Definition: QoreReferenceCounter.h:34
DLLLOCAL bool is_unique() const
returns true if the reference count is 1
Definition: QoreReferenceCounter.h:61
provides a mutually-exclusive thread lock
Definition: QoreThreadLock.h:41
DLLEXPORT ~QoreReferenceCounter()
destroys the reference counter object
DLLEXPORT QoreReferenceCounter()
creates the reference counter object