[pulseaudio-commits] r1403 - /trunk/src/pulsecore/refcnt.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Tue Sep 26 16:42:09 PDT 2006


Author: lennart
Date: Wed Sep 27 01:42:08 2006
New Revision: 1403

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=3D1403&root=3Dpulseaudio&vi=
ew=3Drev
Log:
upgrade refcnt.h to make use of our new pa_atomic_xxx() API

Modified:
    trunk/src/pulsecore/refcnt.h

Modified: trunk/src/pulsecore/refcnt.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/refcnt.h?re=
v=3D1403&root=3Dpulseaudio&r1=3D1402&r2=3D1403&view=3Ddiff
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D
--- trunk/src/pulsecore/refcnt.h (original)
+++ trunk/src/pulsecore/refcnt.h Wed Sep 27 01:42:08 2006
@@ -1,5 +1,5 @@
-#ifndef foopulserefcntfoo
-#define foopulserefcntfoo
+#ifndef foopulserefcnthfoo
+#define foopulserefcnthfoo
 =

 /* $Id$ */
 =

@@ -22,20 +22,21 @@
   USA.
 ***/
 =

-#include <atomic_ops.h>
+#include <pulsecore/atomic.h>
 =

-#define PA_REFCNT_DECLARE volatile AO_t _ref
+#define PA_REFCNT_DECLARE \
+  pa_atomic_int_t _ref
 =

 #define PA_REFCNT_INIT(p) \
-  AO_store_release_write(&(p)->_ref,  1)
+  pa_atomic_store(&p->_ref, 1)
 =

 #define PA_REFCNT_INC(p) \
-  AO_fetch_and_add1_release_write(&(p)->_ref)
+  pa_atomic_inc(&p->_ref)
 =

 #define PA_REFCNT_DEC(p) \
-  (AO_fetch_and_sub1_release_write(&(p)->_ref)-1)
+  (pa_atomic_dec(&p->_ref)-1)
 =

 #define PA_REFCNT_VALUE(p) \
-  AO_load_acquire_read(&(p)->_ref)
+  pa_atomic_load(&p->_ref)
 =

 #endif




More information about the pulseaudio-commits mailing list