Commit 6be1b527 authored by Pierre d'Herbemont's avatar Pierre d'Herbemont

vlc_gc: FixOSAtomic usage.

parent df25be41
......@@ -155,7 +155,7 @@ void *vlc_hold (gc_object_t * p_gc)
#ifdef USE_SYNC
refs = __sync_fetch_and_add (&p_gc->refs, 1);
#elif defined(__APPLE__)
OSAtomicIncrement32Barrier((int*)&p_gc->refs);
refs = OSAtomicIncrement32Barrier((int*)&p_gc->refs) - 1;
#else
vlc_spin_lock (&p_gc->spin);
refs = p_gc->refs++;
......@@ -178,7 +178,7 @@ void vlc_release (gc_object_t *p_gc)
#ifdef USE_SYNC
refs = __sync_fetch_and_sub (&p_gc->refs, 1);
#elif defined(__APPLE__)
OSAtomicDecrement32Barrier((int*)&p_gc->refs);
refs = OSAtomicDecrement32Barrier((int*)&p_gc->refs) + 1;
#else
vlc_spin_lock (&p_gc->spin);
refs = p_gc->refs--;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment