X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=dbus%2Fdbus-threads.h;h=6d28a0b6312921f50cc9e021770e80cb80a54d4d;hb=67f9cca382df0d03adfe6b619aa613d103fa77f6;hp=1fd83f21da9d13210d5dfc29ef765de743a6ff5b;hpb=37019e9d271390fa8c62c1aae62d30bb9068adaa;p=platform%2Fupstream%2Fdbus.git diff --git a/dbus/dbus-threads.h b/dbus/dbus-threads.h index 1fd83f2..6d28a0b 100644 --- a/dbus/dbus-threads.h +++ b/dbus/dbus-threads.h @@ -139,24 +139,15 @@ typedef enum /** * Functions that must be implemented to make the D-Bus library - * thread-aware. The recursive mutex functions should be specified - * rather than the old, deprecated nonrecursive ones. + * thread-aware. * - * The condition variable functions have to work with recursive - * mutexes if you provide those, or with nonrecursive mutexes if you - * provide those. + * If you supply both recursive and non-recursive mutexes, + * libdbus will use the non-recursive version for condition variables, + * and the recursive version in other contexts. * - * If implementing threads using pthreads, be aware that - * PTHREAD_MUTEX_RECURSIVE is broken in combination with condition - * variables. libdbus relies on the Java-style behavior that when - * waiting on a condition, the recursion count is saved and restored, - * and the mutex is completely unlocked, not just decremented one - * level of recursion. - * - * Thus with pthreads you probably have to roll your own emulated - * recursive mutexes, you can't use PTHREAD_MUTEX_RECURSIVE. This is - * what dbus_threads_init_default() does on platforms that use - * pthreads. + * The condition variable functions have to work with nonrecursive + * mutexes if you provide those, or with recursive mutexes if you + * don't. */ typedef struct { @@ -186,7 +177,9 @@ typedef struct } DBusThreadFunctions; +DBUS_EXPORT dbus_bool_t dbus_threads_init (const DBusThreadFunctions *functions); +DBUS_EXPORT dbus_bool_t dbus_threads_init_default (void); /** @} */