dect
/
asterisk
Archived
13
0
Fork 0

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
This commit is contained in:
file 2006-08-17 21:14:03 +00:00
parent 8e9660ffec
commit eb2dec241d
1 changed files with 2 additions and 2 deletions

View File

@ -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),
{