summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMasayuki Yamamoto <ma3yuki.8mamo10@gmail.com>2017-10-06 19:41:34 +0900
committerNick Coghlan <ncoghlan@gmail.com>2017-10-06 20:41:34 +1000
commit731e18901484c75b60167a06a0ba0719a6d4827d (patch)
treefc9b8afc6eb8453729c130a146b838228ab103c6 /configure.ac
parentb8ab9d3fc816f85f4d6dbef12b7414e6dc10e4dd (diff)
downloadcpython-git-731e18901484c75b60167a06a0ba0719a6d4827d.tar.gz
bpo-25658: Implement PEP 539 for Thread Specific Storage (TSS) API (GH-1362)
See PEP 539 for details. Highlights of changes: - Add Thread Specific Storage (TSS) API - Document the Thread Local Storage (TLS) API as deprecated - Update code that used TLS API to use TSS API
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac19
1 files changed, 19 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index b562fe405a..a3114be738 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2263,6 +2263,25 @@ if test "$have_pthread_t" = yes ; then
#endif
])
fi
+
+# Issue #25658: POSIX hasn't defined that pthread_key_t is compatible with int.
+# This checking will be unnecessary after removing deprecated TLS API.
+AC_CHECK_SIZEOF(pthread_key_t, [], [[#include <pthread.h>]])
+AC_MSG_CHECKING(whether pthread_key_t is compatible with int)
+if test "$ac_cv_sizeof_pthread_key_t" -eq "$ac_cv_sizeof_int" ; then
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <pthread.h>]], [[pthread_key_t k; k * 1;]])],
+ [ac_pthread_key_t_is_arithmetic_type=yes],
+ [ac_pthread_key_t_is_arithmetic_type=no]
+ )
+ AC_MSG_RESULT($ac_pthread_key_t_is_arithmetic_type)
+ if test "$ac_pthread_key_t_is_arithmetic_type" = yes ; then
+ AC_DEFINE(PTHREAD_KEY_T_IS_COMPATIBLE_WITH_INT, 1,
+ [Define if pthread_key_t is compatible with int.])
+ fi
+else
+ AC_MSG_RESULT(no)
+fi
CC="$ac_save_cc"
AC_SUBST(OTHER_LIBTOOL_OPT)