summaryrefslogtreecommitdiff
path: root/m4/efl_threads.m4
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-09 12:45:47 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2015-09-09 12:45:47 +0900
commit5625aac4d4860730428a0bca421f447425292aec (patch)
tree53049cbf421cea4b8f83b7b88f36729182b550d1 /m4/efl_threads.m4
parent712db856a2738505f245f2c0c98b3419993246de (diff)
eina thread - add wrapper for setting thread name and fix affinity
added support to set thread names for debugging. this wraps the gnu extension to set a thread name of up to 15 chars (16 inc nul byte). eina_thread_name_set() is the new api. @feature in the process i found the autofoo wasnt enabling cpu affinity support at all in reality, so i had to fix that at the same time.
Diffstat (limited to 'm4/efl_threads.m4')
-rw-r--r--m4/efl_threads.m415
1 files changed, 15 insertions, 0 deletions
diff --git a/m4/efl_threads.m4 b/m4/efl_threads.m4
index 88317af..4ed9ff2 100644
--- a/m4/efl_threads.m4
+++ b/m4/efl_threads.m4
@@ -62,6 +62,17 @@ pthread_attr_setaffinity_np(NULL, 0, NULL);
62 ]])], 62 ]])],
63 [efl_have_setaffinity="yes"], 63 [efl_have_setaffinity="yes"],
64 [efl_have_setaffinity="no"]) 64 [efl_have_setaffinity="no"])
65 AC_LINK_IFELSE(
66 [AC_LANG_PROGRAM([[
67#define _GNU_SOURCE
68#include <stdlib.h>
69#include <pthread.h>
70 ]],
71 [[
72pthread_setname_np(NULL, NULL);
73 ]])],
74 [efl_have_setname="yes"],
75 [efl_have_setname="no"])
65 LIBS=${SAVE_LIBS} 76 LIBS=${SAVE_LIBS}
66fi 77fi
67 78
@@ -71,10 +82,14 @@ if test "x${_efl_have_posix_threads}" = "xyes" ; then
71else 82else
72 if test "x${_efl_have_win32_threads}" = "xyes" ; then 83 if test "x${_efl_have_win32_threads}" = "xyes" ; then
73 efl_have_threads="Windows" 84 efl_have_threads="Windows"
85 efl_have_pthread_affinity="no"
74 efl_have_pthread_barrier="no" 86 efl_have_pthread_barrier="no"
87 efl_have_pthread_setname="no"
75 else 88 else
76 efl_have_threads="no" 89 efl_have_threads="no"
90 efl_have_pthread_affinity="no"
77 efl_have_pthread_barrier="no" 91 efl_have_pthread_barrier="no"
92 efl_have_pthread_setname="no"
78 fi 93 fi
79fi 94fi
80AC_MSG_RESULT([${efl_have_threads}]) 95AC_MSG_RESULT([${efl_have_threads}])