Special, for-tests-only, mode with atomics emulated by a mutex-locked variable - useful for finding atomics congestions

This commit is contained in:
Witold Kręcicki
2019-05-17 11:35:35 +02:00
parent 5aeb99786e
commit 92424e23fa
7 changed files with 228 additions and 22 deletions

View File

@@ -132,6 +132,27 @@ AS_IF([test "$enable_fuzzing" = "afl"],
[AC_MSG_ERROR([set CC=afl-<gcc|clang> when --enable-fuzzing=afl is used])])
])
AC_ARG_ENABLE(mutex_atomics,
AS_HELP_STRING([--enable-mutex-atomics],
[emulate atomics by mutex-locked variables, useful for debugging
[default=no]]),
[],
[enable_mutex_atomics=no])
AC_MSG_CHECKING([whether to emulate atomics with mutexes])
case "$enable_mutex_atomics" in
yes)
AC_MSG_RESULT(yes)
AC_DEFINE(ISC_MUTEX_ATOMICS, 1, [Define to emulate atomic variables with mutexes.])
;;
no)
AC_MSG_RESULT(no)
;;
*)
AC_MSG_ERROR("--enable-mutex-atomics requires yes or no")
;;
esac
#
# Make very sure that these are the first files processed by
# config.status, since we use the processed output as the input for