From 4ea036c26dd921c4fce18db3e54f551e9f856a07 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Mon, 4 Feb 2013 12:26:47 +0100 Subject: libreplace: Add support for pthread_mutex_consistent Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- lib/replace/system/threads.h | 5 +++++ lib/replace/wscript | 14 ++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/lib/replace/system/threads.h b/lib/replace/system/threads.h index 3d89bb2e98f..3aca088c132 100644 --- a/lib/replace/system/threads.h +++ b/lib/replace/system/threads.h @@ -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 diff --git a/lib/replace/wscript b/lib/replace/wscript index 987b56b38c2..fd53999dce1 100644 --- a/lib/replace/wscript +++ b/lib/replace/wscript @@ -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) -- cgit