aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-01-28 18:19:36 -0800
committerAvatar Saleem Abdulrasool <compnerd@compnerd.org> 2016-02-14 23:12:29 -0800
commite42d5ffe29b4cd6cf9bac0f36fe37ec5001dfd68 (patch)
tree618a32afdb1555e9944e68f379695b7dfe6a1234 /configure.ac
parente0f11780797f6ddee5bdfd965c7f499e8810c2b4 (diff)
downloadpaludis-e42d5ffe29b4cd6cf9bac0f36fe37ec5001dfd68.tar.gz
paludis-e42d5ffe29b4cd6cf9bac0f36fe37ec5001dfd68.tar.xz
switch TLS to C++11 TLS semantics
Rather than using the compiler specific `__thread` mechanism for TLS, use the C++11 standard `thread_local` keyword. This removes the check for the `__thread` keyword and the `PALUDIS_TLS` macro in the single usage site. Take advantage of the fact that `thread_local` can be applied to non-POD types to avoid the heap allocation of the context buffer and letting the loader perform the allocation. This has a slight penalty (an extra function call) on thread construction. However, given that the heap allocation would likely be performed, this will be largely offset by the loss of the allocation.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac11
1 files changed, 0 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index da6ee9b97..7c1fe4f6f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,17 +235,6 @@ fi
PTHREAD_LIBS=""
RT_LIBS=""
-AC_MSG_CHECKING([for compiler __thread support])
-AC_COMPILE_IFELSE([AC_LANG_SOURCE([
-int main(int, char **)
-{
- static __thread int x(0);
- return x;
-}
-])],
-[AC_MSG_RESULT([yes])],
-[AC_MSG_RESULT([no])
-AC_MSG_ERROR([Your compiler does not support __thread])])
AC_MSG_CHECKING([whether -pthread -lpthread gets us posix threads])
save_CXXFLAGS=$CXXFLAGS