summaryrefslogtreecommitdiff
path: root/m4/efl_threads.m4
diff options
context:
space:
mode:
authorJean Guyomarc'h <jean.guyomarch@gmail.com>2014-08-21 11:23:24 +0200
committerCedric BAIL <cedric@osg.samsung.com>2014-08-21 12:04:53 +0200
commitf449f0ddb6c030e1763cc549caac5e162efbca74 (patch)
treeb108946ace8d71909c36ab0facbb2bcbbc6438be /m4/efl_threads.m4
parentf5b81093978fbbe411f9fb509617b6f4081f8da8 (diff)
eina: port Eina_Spinlock for OSX
Summary: Support of Spinlocks in Eina (Eina_Spinlock) for OSX, which does not implement them in pthread. @feature Reviewers: raster, raoulh, naguirre, cedric, stefan_schmidt Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1151 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to '')
-rw-r--r--m4/efl_threads.m429
1 files changed, 29 insertions, 0 deletions
diff --git a/m4/efl_threads.m4 b/m4/efl_threads.m4
index 04b3e64..9596908 100644
--- a/m4/efl_threads.m4
+++ b/m4/efl_threads.m4
@@ -125,8 +125,37 @@ if test "x${efl_have_posix_threads_spinlock}" = "xyes" ; then
125 AC_DEFINE([EFL_HAVE_POSIX_THREADS_SPINLOCK], [1], [Define to mention that POSIX threads spinlocks are supported]) 125 AC_DEFINE([EFL_HAVE_POSIX_THREADS_SPINLOCK], [1], [Define to mention that POSIX threads spinlocks are supported])
126fi 126fi
127 127
128
129dnl checks if the compiler supports OSX spinlock
130
131efl_have_osx_spinlock="no"
132
133if test "x${_efl_have_posix_threads}" = "xyes" ; then
134 AC_LINK_IFELSE(
135 [AC_LANG_PROGRAM([[
136#include <libkern/OSAtomic.h>
137 ]],
138 [[
139OSSpinLock spin_lock = 0;
140OSSpinLockTry(&spin_lock);
141 ]])],
142 [efl_have_osx_spinlock="yes"],
143 [efl_have_osx_spinlock="no"])
144fi
145
146AC_MSG_CHECKING([whether to build OSX spinlock code])
147AC_MSG_RESULT([${efl_have_osx_spinlock}])
148
149if test "x${efl_have_osx_spinlock}" = "xyes" ; then
150 AC_DEFINE([EFL_HAVE_OSX_SPINLOCK], [1], [Define to mention that OSX spinlocks are supported])
151fi
152
153
154
128AS_IF([test "x$_efl_have_posix_threads" = "xyes" || test "x$_efl_have_win32_threads" = "xyes"], 155AS_IF([test "x$_efl_have_posix_threads" = "xyes" || test "x$_efl_have_win32_threads" = "xyes"],
129 [$1], 156 [$1],
130 [m4_if([$2], [$2], [AC_MSG_ERROR([Threads are required.])])]) 157 [m4_if([$2], [$2], [AC_MSG_ERROR([Threads are required.])])])
131 158
159
132]) 160])
161