/* define if PKCS11 is used for Public-Key Cryptography */
#undef USE_PKCS11
+/* Define if you want to use pthread rwlock implementation */
+#undef USE_PTHREAD_RWLOCK
+
/* Enable extensions on AIX 3, Interix. */
#ifndef _ALL_SOURCE
# undef _ALL_SOURCE
with_geoip
with_locktype
with_libtool
+enable_pthread_rwlock
with_openssl
enable_fips_mode
with_cc_alg
--enable-kqueue use BSD kqueue when available [default=yes]
--enable-epoll use Linux epoll when available [default=auto]
--enable-devpoll use /dev/poll when available [default=yes]
+ --enable-pthread-rwlock use pthread rwlock instead of internal rwlock
+ implementation (EXPERIMENTAL)
--enable-fips-mode enable FIPS mode in OpenSSL library [default=no]
--enable-native-pkcs11 use native PKCS11 for public-key crypto [default=no]
--enable-backtrace log stack backtrace on abort [default=yes]
esac
-for ac_func in pthread_rwlock_rdlock
+#
+# Do we want to use pthread rwlock? (useful for ThreadSanitizer)
+#
+# Check whether --enable-pthread_rwlock was given.
+if test "${enable_pthread_rwlock+set}" = set; then :
+ enableval=$enable_pthread_rwlock;
+else
+ enable_pthread_rwlock=no
+fi
+
+
+if test "$enable_pthread_rwlock" = "yes"; then :
+ for ac_func in pthread_rwlock_rdlock
do :
ac_fn_c_check_func "$LINENO" "pthread_rwlock_rdlock" "ac_cv_func_pthread_rwlock_rdlock"
if test "x$ac_cv_func_pthread_rwlock_rdlock" = xyes; then :
#define HAVE_PTHREAD_RWLOCK_RDLOCK 1
_ACEOF
+else
+ as_fn_error $? "pthread_rwlock_rdlock requested but not found" "$LINENO" 5
fi
done
+$as_echo "#define USE_PTHREAD_RWLOCK 1" >>confdefs.h
+
+
+fi
+
CRYPTO=OpenSSL
#
esac
AC_SUBST(INSTALL_LIBRARY)
-AC_CHECK_FUNCS([pthread_rwlock_rdlock])
+#
+# Do we want to use pthread rwlock? (useful for ThreadSanitizer)
+#
+AC_ARG_ENABLE([pthread_rwlock],
+ [AS_HELP_STRING([--enable-pthread-rwlock],
+ [use pthread rwlock instead of internal rwlock implementation (EXPERIMENTAL)])],
+ [], [enable_pthread_rwlock=no])
+
+AS_IF([test "$enable_pthread_rwlock" = "yes"],
+ [AC_CHECK_FUNCS([pthread_rwlock_rdlock], [],
+ [AC_MSG_ERROR([pthread_rwlock_rdlock requested but not found])])
+ AC_DEFINE([USE_PTHREAD_RWLOCK],[1],[Define if you want to use pthread rwlock implementation])
+ ])
CRYPTO=OpenSSL
isc_rwlocktype_write
} isc_rwlocktype_t;
-#if HAVE_PTHREAD_RWLOCK_RDLOCK
+#if USE_PTHREAD_RWLOCK
struct isc_rwlock {
pthread_rwlock_t rwlock;
atomic_bool downgrade;
};
-#else /* HAVE_PTHREAD_RWLOCK_RDLOCK */
+#else /* USE_PTHREAD_RWLOCK */
struct isc_rwlock {
/* Unlocked. */
};
-#endif /* HAVE_PTHREAD_RWLOCK_RDLOCK */
+#endif /* USE_PTHREAD_RWLOCK */
isc_result_t
isc_rwlock_init(isc_rwlock_t *rwl, unsigned int read_quota,
#include <isc/rwlock.h>
#include <isc/util.h>
-#if HAVE_PTHREAD_RWLOCK_RDLOCK
+#if USE_PTHREAD_RWLOCK
#include <errno.h>
#include <pthread.h>
return (ISC_R_SUCCESS);
}
-#endif /* HAVE_PTHREAD_RWLOCK_RDLOCK */
+#endif /* USE_PTHREAD_RWLOCK */