Use the memory barrier variants on OS X

This commit is contained in:
Lukáš Lalinský 2011-03-12 23:21:54 +01:00
parent 223b85d345
commit 41f1828719

View File

@ -99,8 +99,8 @@ namespace TagLib {
RefCounter() : refCount(1) {}
#ifdef TAGLIB_ATOMIC_MAC
void ref() { OSAtomicIncrement32(&refCount); }
bool deref() { return ! OSAtomicDecrement32(&refCount); }
void ref() { OSAtomicIncrement32Barrier(&refCount); }
bool deref() { return ! OSAtomicDecrement32Barrier(&refCount); }
int32_t count() { return refCount; }
private:
volatile int32_t refCount;