- void ref() const { ++mRefCount; RCDEBUG(UP, mRefCount); }
- unsigned int unref() const { RCDEBUG(DOWN, mRefCount - 1); return --mRefCount; }
+ void ref() const
+ {
+ OSAtomicIncrement32(&mRefCount);
+ RCDEBUG(UP, mRefCount);
+ }
+
+ unsigned int unref() const
+ {
+ RCDEBUG(DOWN, mRefCount - 1);
+ return OSAtomicDecrement32(&mRefCount);
+ }