libreplace: Add support for pthread_mutex_consistent
authorVolker Lendecke <vl@samba.org>
Mon, 4 Feb 2013 11:26:47 +0000 (12:26 +0100)
committerJeremy Allison <jra@samba.org>
Thu, 22 May 2014 19:05:15 +0000 (21:05 +0200)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/replace/system/threads.h
lib/replace/wscript

index 3d89bb2e98feca9df13aba0532a24bc2e57c78a7..3aca088c132b4871de9d6a98ff4edddc9d235f86 100644 (file)
@@ -32,4 +32,9 @@
 #define pthread_mutexattr_setrobust pthread_mutexattr_setrobust_np
 #endif
 
+#if defined(HAVE_PTHREAD_MUTEX_CONSISTENT_NP) && \
+       !defined(HAVE_PTHREAD_MUTEX_CONSISTENT)
+#define pthread_mutex_consistent pthread_mutex_consistent_np
+#endif
+
 #endif
index 987b56b38c2a408d7411dcf8f46de5501b722682..fd53999dce1fa3ba03deef198aa6d4c20a60f8fb 100644 (file)
@@ -465,8 +465,18 @@ removeea setea
         conf.CHECK_FUNCS_IN('pthread_mutexattr_setrobust_np', 'pthread',
                             checklibc=True, headers='pthread.h')
 
-        if (conf.CONFIG_SET('HAVE_PTHREAD_MUTEXATTR_SETROBUST') or
-            conf.CONFIG_SET('HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP')):
+        conf.CHECK_DECLS('pthread_mutex_consistent', headers='pthread.h')
+        conf.CHECK_FUNCS_IN('pthread_mutex_consistent', 'pthread',
+                            checklibc=True, headers='pthread.h')
+
+        conf.CHECK_DECLS('pthread_mutex_consistent_np', headers='pthread.h')
+        conf.CHECK_FUNCS_IN('pthread_mutex_consistent_np', 'pthread',
+                            checklibc=True, headers='pthread.h')
+
+        if ((conf.CONFIG_SET('HAVE_PTHREAD_MUTEXATTR_SETROBUST') or
+             conf.CONFIG_SET('HAVE_PTHREAD_MUTEXATTR_SETROBUST_NP')) and
+            (conf.CONFIG_SET('HAVE_PTHREAD_MUTEX_CONSISTENT') or
+             conf.CONFIG_SET('HAVE_PTHREAD_MUTEX_CONSISTENT_NP'))):
             conf.DEFINE('HAVE_ROBUST_MUTEXES', 1)
 
     conf.CHECK_FUNCS_IN('crypt', 'crypt', checklibc=True)