summaryrefslogtreecommitdiff
path: root/m4/pthreads.m4
diff options
context:
space:
mode:
authorDarren Salt <linux@youmustbejoking.demon.co.uk>2007-05-31 14:08:52 +0100
committerDarren Salt <linux@youmustbejoking.demon.co.uk>2007-05-31 14:08:52 +0100
commitb0607c580af756ff0ccd1229d91b4b6a97c76d24 (patch)
tree27f64134720fc9dca224e6313b0505fa43cb8dd8 /m4/pthreads.m4
parentfe2112a1ac52fbf65e2624b978f9d33f04b6af56 (diff)
parentadebccc0fc011b6d1abe2f682bbfc866dffee73e (diff)
downloadxine-lib-b0607c580af756ff0ccd1229d91b4b6a97c76d24.tar.gz
xine-lib-b0607c580af756ff0ccd1229d91b4b6a97c76d24.tar.bz2
Merge -newbuild.
Diffstat (limited to 'm4/pthreads.m4')
-rw-r--r--m4/pthreads.m425
1 files changed, 25 insertions, 0 deletions
diff --git a/m4/pthreads.m4 b/m4/pthreads.m4
index 363a8b4b2..d68cd13c8 100644
--- a/m4/pthreads.m4
+++ b/m4/pthreads.m4
@@ -61,3 +61,28 @@ AC_DEFUN([CC_PTHREAD_FLAGS], [
ifelse([$2], , [:], [$2])
fi
])
+
+AC_DEFUN([CC_PTHREAD_RECURSIVE_MUTEX], [
+ AC_REQUIRE([CC_PTHREAD_FLAGS])
+ AC_MSG_CHECKING([for recursive mutex support in pthread])
+
+ ac_save_LIBS="$LIBS"
+ LIBS="$LIBS $PTHREAD_LIBS"
+ AC_COMPILE_IFELSE(AC_LANG_SOURCE([#include <pthread.h>
+
+int main() {
+ pthread_mutexattr_t attr;
+ pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);
+ return 0;
+}
+ ]), [have_recursive_mutex=yes], [have_recursive_mutex=no])
+ LIBS="$ac_save_LIBS"
+
+ AC_MSG_RESULT([$have_recursive_mutex])
+
+ if test x"$have_recursive_mutex" = x"yes"; then
+ ifelse([$1], , [:], [$1])
+ else
+ ifelse([$2], , [:], [$2])
+ fi
+])