summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2018-11-21 00:19:20 +0300
committerIvan Maidanski <ivmai@mail.ru>2018-11-21 00:19:20 +0300
commit016f30060f3c34a69387fa64e1f75f69057d57c0 (patch)
tree5249a13d3708ec3143c9d0d8bca9f9b840f03310 /configure.ac
parent70283bbb4590a386ab11201feb578ed50166f030 (diff)
downloadbdwgc-016f30060f3c34a69387fa64e1f75f69057d57c0.tar.gz
Fix a deadlock in write_fault_handler if AO_or is emulated
* configure.ac [$with_libatomic_ops!=none && $need_atomic_ops_asm!=true] (HAVE_LOCKFREE_AO_OR): New AC_DEFINE (defined in case of success of AC_TRY_LINK of a code snippet calling AO_or). * include/private/gc_atomic_ops.h [GC_BUILTIN_ATOMIC && !NO_LOCKFREE_AO_OR] (HAVE_LOCKFREE_AO_OR): Define (to 1). * include/private/gc_priv.h [THREADS] (GC_acquire_dirty_lock, GC_release_dirty_lock): Define to no-op only if HAVE_LOCKFREE_AO_OR or GC_DISABLE_INCREMENTAL. * os_dep.c [!GC_DISABLE_INCREMENTAL] (async_set_pht_entry_from_index): Use set_pht_entry_from_index_concurrent() only if HAVE_LOCKFREE_AO_OR (or not THREADS).
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 7 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 7db06459..0fd56663 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1109,6 +1109,13 @@ AM_CONDITIONAL([NEED_ATOMIC_OPS_ASM],
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;