From fdbf1539ed98c830d22eae2a678df242c0a129f6 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 13 Apr 2011 14:49:26 +0100 Subject: [PATCH] add API to check whether mutexes are going to be recursive dbus-glib could use this to solve Bug #14581. Bug: https://bugs.freedesktop.org/show_bug.cgi?id=36205 --- dbus/dbus-threads.c | 6 ++++++ dbus/dbus-threads.h | 3 +++ 2 files changed, 9 insertions(+), 0 deletions(-) diff --git a/dbus/dbus-threads.c b/dbus/dbus-threads.c index 37b68ba..c9c47aa 100644 --- a/dbus/dbus-threads.c +++ b/dbus/dbus-threads.c @@ -676,6 +676,12 @@ dbus_threads_init_default (void) return _dbus_threads_init_platform_specific (); } +dbus_bool_t +dbus_threads_mutexes_are_recursive (void) +{ + /* dbus_threads_init() checks that if we supplied one, we supplied all */ + return (thread_functions.mask & DBUS_THREAD_FUNCTIONS_RECURSIVE_MUTEX_NEW_MASK) != 0; +} /** @} */ diff --git a/dbus/dbus-threads.h b/dbus/dbus-threads.h index ba07ca5..039598a 100644 --- a/dbus/dbus-threads.h +++ b/dbus/dbus-threads.h @@ -191,6 +191,9 @@ dbus_bool_t dbus_threads_init (const DBusThreadFunctions *functions); DBUS_EXPORT dbus_bool_t dbus_threads_init_default (void); +DBUS_EXPORT +dbus_bool_t dbus_threads_mutexes_are_recursive (void); + /** @} */ DBUS_END_DECLS -- 1.7.4.1