[svn-commits] fjoe: freebsd/trunk r7834 - /freebsd/trunk/include/dahdi/compat/bsd.h

SVN commits to the Digium repositories svn-commits at lists.digium.com
Sun Jan 10 14:53:39 CST 2010


Author: fjoe
Date: Sun Jan 10 14:53:36 2010
New Revision: 7834

URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7834
Log:
Add atomic_dec_and_test() definition.

Modified:
    freebsd/trunk/include/dahdi/compat/bsd.h

Modified: freebsd/trunk/include/dahdi/compat/bsd.h
URL: http://svnview.digium.com/svn/dahdi/freebsd/trunk/include/dahdi/compat/bsd.h?view=diff&rev=7834&r1=7833&r2=7834
==============================================================================
--- freebsd/trunk/include/dahdi/compat/bsd.h (original)
+++ freebsd/trunk/include/dahdi/compat/bsd.h Sun Jan 10 14:53:36 2010
@@ -62,6 +62,7 @@
 #define atomic_read(p)		(*(p))
 #define atomic_inc(p)		atomic_add_int(p, 1)
 #define atomic_dec(p)		atomic_subtract_int(p, 1)
+#define atomic_dec_and_test(p)	(atomic_fetchadd_int(p, -1) == 1)
 #define atomic_add(v, p)	atomic_add_int(p, v)
 #define atomic_sub(v, p)	atomic_subtract_int(p, v)
 




More information about the svn-commits mailing list