Use USE_PTHREAD_RWLOCK instead of generic HAVE_PTHREAD_RWLOCK_RDLOCK to enable pthread rwlocks to prevent accidentally enabling the feature

This commit is contained in:
Ondřej Surý
2019-05-14 00:59:06 +07:00
parent 00441917e0
commit f9ae267158
3 changed files with 22 additions and 11 deletions
+3
View File
@@ -556,6 +556,9 @@
/* 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
Vendored
+10 -4
View File
@@ -15602,14 +15602,14 @@ esac
#
# Check whether --enable-pthread_rwlock was given.
if test "${enable_pthread_rwlock+set}" = set; then :
enableval=$enable_pthread_rwlock; use_pthread_rwlock=$enableval
enableval=$enable_pthread_rwlock;
else
use_pthread_rwlock=no
enable_pthread_rwlock=no
fi
if test "x$use_pthread_rwlock" != "xno"; then
for ac_func in pthread_rwlock_rdlock
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 :
@@ -15617,9 +15617,15 @@ 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
#
+9 -7
View File
@@ -727,14 +727,16 @@ AC_SUBST(INSTALL_LIBRARY)
# 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]),
use_pthread_rwlock=$enableval, use_pthread_rwlock=no)
AC_ARG_ENABLE([pthread_rwlock],
[AS_HELP_STRING([--enable-pthread-rwlock],
[use pthread rwlock instead of internal rwlock implementation])],
[], [enable_pthread_rwlock=no])
if test "x$use_pthread_rwlock" != "xno"; then
AC_CHECK_FUNCS([pthread_rwlock_rdlock])
fi
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])
])
#
# If PIC is disabled, shared libraries must also be