summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTom Hacohen <tom@stosb.com>2015-10-16 15:13:51 +0100
committerTom Hacohen <tom@stosb.com>2015-11-09 11:43:04 +0000
commit0bebaed0acd3b07d2d85e0269344f628a5d9e575 (patch)
tree495f6e9d70a859c18e7c73a1461c364e923b52ac /configure.ac
parent3e40b45be65b21a9941a1531c721216c3301d7a8 (diff)
downloadefl-0bebaed0acd3b07d2d85e0269344f628a5d9e575.tar.gz
Eo do: use the __thread directive when available to manage call stack.
This is faster in most cases, and to be honest, should be much faster than it is. I don't understand why there's no better directive to mark a variable as *really* important thread storage that is used all the time.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 15 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 5ecbcac4f6..f0980adf7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -984,6 +984,20 @@ if test "x${efl_have_threads}" = "xno"; then
CFOPT_WARNING="xyes"
fi
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[ ]],
+ [[
+ static __thread int a = 0;
+ ]])],
+ [have_thread_specifier="yes"],
+ [have_thread_specifier="no"])
+AC_MSG_CHECKING([for __thread specifier])
+AC_MSG_RESULT([${have_thread_specifier}])
+if test "x${have_thread_specifier}" = "xyes" ; then
+ AC_DEFINE([HAVE_THREAD_SPECIFIER], [1], [Have the __thread specifier])
+fi
+
EFL_ADD_PUBLIC_LIBS([EINA], [${EFL_PTHREAD_LIBS}])
EFL_ADD_CFLAGS([EINA], [${EFL_PTHREAD_CFLAGS}])
@@ -4868,6 +4882,7 @@ EFL_ADD_FEATURE([thread], [spinlocks], [${efl_have_spinlock}])
EFL_ADD_FEATURE([thread], [barrier], [${efl_have_pthread_barrier}])
EFL_ADD_FEATURE([thread], [affinity], [${efl_have_setaffinity}])
EFL_ADD_FEATURE([thread], [setname], [${efl_have_setname}])
+EFL_ADD_FEATURE([thread], [__thread], [${have_thread_specifier}])
echo
echo