aboutsummaryrefslogtreecommitdiffstats
path: root/erts/aclocal.m4
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2014-11-07 14:41:02 +0100
committerRickard Green <[email protected]>2014-11-10 14:20:01 +0100
commitd5a4eb5a9e24a07cb3653967ff91557c9a21ecb4 (patch)
tree1396ce6eb1792e3a4e4d174f9b26d6c45feca9c8 /erts/aclocal.m4
parent9417f044ee3c291c2ea343c203aebdcc40597226 (diff)
downloadotp-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 'erts/aclocal.m4')
-rw-r--r--erts/aclocal.m422
1 files changed, 22 insertions, 0 deletions
diff --git a/erts/aclocal.m4 b/erts/aclocal.m4
index ed492d55ff..d78025b0be 100644
--- a/erts/aclocal.m4
+++ b/erts/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])