AS_IF([test x$with_libatomic_ops != xnone -a x$need_atomic_ops_asm != xtrue],
[ old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $AO_TRYLINK_CFLAGS $CFLAGS_EXTRA"
+ AC_MSG_CHECKING([for lock-free AO_or primitive])
+ AC_TRY_LINK([#include "atomic_ops.h"],
+ [AO_t x=0;AO_or(&x,1)],
+ [ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_LOCKFREE_AO_OR], [1],
+ [libatomic_ops AO_or primitive implementation is lock-free.]) ],
+ [ AC_MSG_RESULT(no) ])
AC_MSG_CHECKING([for lock-free AO load/store, test-and-set primitives])
AC_TRY_LINK([#include "atomic_ops.h"],
[AO_t x=0;unsigned char c=0;AO_TS_t z=AO_TS_INITIALIZER;
} /* extern "C" */
# endif
+# ifndef NO_LOCKFREE_AO_OR
+ /* __atomic_or_fetch is assumed to be lock-free. */
+# define HAVE_LOCKFREE_AO_OR 1
+# endif
+
#else
/* Fallback to libatomic_ops. */
# include "atomic_ops.h"
/* protected by GC_write_cs. */
# endif
-# if defined(GC_DISABLE_INCREMENTAL) || defined(AO_HAVE_or)
+# if defined(GC_DISABLE_INCREMENTAL) || defined(HAVE_LOCKFREE_AO_OR)
# define GC_acquire_dirty_lock() (void)0
# define GC_release_dirty_lock() (void)0
# else
#endif /* DEFAULT_VDB */
#ifndef GC_DISABLE_INCREMENTAL
-# if !defined(THREADS) || defined(AO_HAVE_or)
+# if !defined(THREADS) || defined(HAVE_LOCKFREE_AO_OR)
# define async_set_pht_entry_from_index(db, index) \
set_pht_entry_from_index_concurrent(db, index)
# elif defined(AO_HAVE_test_and_set_acquire)