diff options
author | Rickard Green <[email protected]> | 2014-11-07 14:41:02 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2014-11-10 14:20:01 +0100 |
commit | d5a4eb5a9e24a07cb3653967ff91557c9a21ecb4 (patch) | |
tree | 1396ce6eb1792e3a4e4d174f9b26d6c45feca9c8 /lib/megaco/aclocal.m4 | |
parent | 9417f044ee3c291c2ea343c203aebdcc40597226 (diff) | |
download | otp-d5a4eb5a9e24a07cb3653967ff91557c9a21ecb4.tar.gz otp-d5a4eb5a9e24a07cb3653967ff91557c9a21ecb4.tar.bz2 otp-d5a4eb5a9e24a07cb3653967ff91557c9a21ecb4.zip |
Improve usage of libatomic_ops for word size atomics
Use AO_fetch_compare_and_swap*() when present
Diffstat (limited to 'lib/megaco/aclocal.m4')
-rw-r--r-- | lib/megaco/aclocal.m4 | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/megaco/aclocal.m4 b/lib/megaco/aclocal.m4 index ed492d55ff..d78025b0be 100644 --- a/lib/megaco/aclocal.m4 +++ b/lib/megaco/aclocal.m4 @@ -1421,9 +1421,31 @@ case "$THR_LIB_NAME" in int z; AO_nop_full(); +#if defined(AO_HAVE_store) AO_store(&x, (AO_t) 0); +#elif defined(AO_HAVE_store_release) + AO_store_release(&x, (AO_t) 0); +#else +#error No store +#endif +#if defined(AO_HAVE_load) z = AO_load(&x); +#elif defined(AO_HAVE_load_acquire) + z = AO_load_acquire(&x); +#else +#error No load +#endif +#if defined(AO_HAVE_compare_and_swap_full) z = AO_compare_and_swap_full(&x, (AO_t) 0, (AO_t) 1); +#elif defined(AO_HAVE_compare_and_swap_release) + z = AO_compare_and_swap_release(&x, (AO_t) 0, (AO_t) 1); +#elif defined(AO_HAVE_compare_and_swap_acquire) + z = AO_compare_and_swap_acquire(&x, (AO_t) 0, (AO_t) 1); +#elif defined(AO_HAVE_compare_and_swap) + z = AO_compare_and_swap(&x, (AO_t) 0, (AO_t) 1); +#else +#error No compare_and_swap +#endif ], [ethr_have_native_atomics=yes ethr_have_libatomic_ops=yes]) |