[vlc-devel] commit: vlc_gc: FixOSAtomic usage. (Pierre d'Herbemont )
git version control
git at videolan.org
Sat Sep 20 02:32:42 CEST 2008
vlc | branch: master | Pierre d'Herbemont <pdherbemont at videolan.org> | Sat Sep 20 02:35:43 2008 +0200| [6be1b527c05426ec9c62025a89ee589d64045077] | committer: Pierre d'Herbemont
vlc_gc: FixOSAtomic usage.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6be1b527c05426ec9c62025a89ee589d64045077
---
src/libvlc.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/libvlc.c b/src/libvlc.c
index 07e25d3..07347a1 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -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--;
More information about the vlc-devel
mailing list