]> granicus.if.org Git - gc/commitdiff
Add a sanity check that load_acquire and store_release are available
authorIvan Maidanski <ivmai@mail.ru>
Wed, 29 Nov 2017 18:26:28 +0000 (21:26 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 29 Nov 2017 18:26:28 +0000 (21:26 +0300)
* pthread_stop_world.c [(!AO_HAVE_load_acquire
|| !AO_HAVE_store_release) && !CPPCHECK]: Issue error that
libatomic_ops does not define AO_load_acquire and/or AO_store_release
so the client should manually define AO_REQUIRE_CAS macro.

pthread_stop_world.c

index c012f66b552b0ec6504b8807d1513a0f05bd90b2..a345de8a48e104763a871d88c6f869023289e193 100644 (file)
 
 #include "private/gc_atomic_ops.h"
 
+#if (!defined(AO_HAVE_load_acquire) || !defined(AO_HAVE_store_release)) \
+    && !defined(CPPCHECK)
+# error AO_load_acquire and/or AO_store_release are missing;
+# error please define AO_REQUIRE_CAS manually
+#endif
+
 /* It's safe to call original pthread_sigmask() here.   */
 #undef pthread_sigmask