aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-17 21:14:03 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2006-08-17 21:14:03 +0000
commiteb2dec241d3620dec5e74e6af9312e75040d6464 (patch)
tree3492019c2857f7d978e710b103e6d9975fed7593 /include
parent8e9660ffec15d08cba818694244a3b2bdc2ae4dd (diff)
Use OSAtomicAdd instead of OSAtomicDecrement to decrement the value by 1.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@40303 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/lock.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/asterisk/lock.h b/include/asterisk/lock.h
index ad7b4e451..3ffb32e8e 100644
--- a/include/asterisk/lock.h
+++ b/include/asterisk/lock.h
@@ -789,12 +789,12 @@ AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
#elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 4)
AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
{
- return OSAtomicDecrement32((int32_t *) p) == 0;
+ return OSAtomicAdd32( -1, (int32_t *) p) == 0;
})
#elif defined(HAVE_OSX_ATOMICS) && (SIZEOF_INT == 8)
AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
{
- return OSAtomicDecrement64((int64_t *) p) == 0;
+ return OSAtomicAdd64( -1, (int64_t *) p) == 0;
#else
AST_INLINE_API(int ast_atomic_dec_and_test(volatile int *p),
{