Bug 36205 - provide dbus_threads_mutexes_are_recursive()
Summary: provide dbus_threads_mutexes_are_recursive()
Status: RESOLVED INVALID
Alias: None
Product: dbus
Classification: Unclassified
Component: core (show other bugs)
Version: 1.5
Hardware: Other All
: medium enhancement
Assignee: Simon McVittie
QA Contact: John (J5) Palmieri
URL:
Whiteboard:
Keywords: patch
Depends on:
Blocks: 14581
  Show dependency treegraph
 
Reported: 2011-04-13 06:47 UTC by Simon McVittie
Modified: 2012-02-21 08:50 UTC (History)
3 users (show)

See Also:
i915 platform:
i915 features:


Attachments
add API to check whether mutexes are going to be recursive (1.34 KB, patch)
2011-04-13 06:50 UTC, Simon McVittie
Details | Splinter Review

Description Simon McVittie 2011-04-13 06:47:18 UTC
+++ This bug was initially created as a clone of Bug #14581 +++

Havoc wrote:
> Maybe adding dbus_threads_has_recursive_mutex() makes sense, though it would
> just be a nice thing for anyone installing their own thread functions, which is
> probably nobody.
> 
> Otherwise we can just assume dbus_threads_init_default() was used and that it
> has recursive mutexes, so just remove the limitation on dbus-glib mainloop
> source (assuming things work if you do so, I haven't tested it or anything).

However, the Windows threading implementation doesn't yet have recursive mutexes (Bug #36204), so dbus-glib ought to check. Patch on the way.
Comment 1 Simon McVittie 2011-04-13 06:50:41 UTC
Created attachment 45576 [details] [review]
add API to check whether mutexes are going to be recursive

dbus-glib could use this to solve Bug #14581.

(Untested, but trivial.)
Comment 2 Havoc Pennington 2011-04-18 18:12:45 UTC
Doesn't GThread with recursive mutexes just work on windows anyhow? maybe the winthread stuff inside libdbus shouldn't be used, esp. if nobody is fixing it.
Comment 3 Simon McVittie 2011-04-19 00:56:50 UTC
(In reply to comment #2)
> Doesn't GThread with recursive mutexes just work on windows anyhow?

We haven't used GThread for quite a long time; dbus-glib just uses dbus_threads_init_default(). D-Bus for Windows has its own mutex/etc. functions, and D-Bus for Unix uses simple wrappers around pthread similar to the ones in GLib.

When dbus-glib did have its own threading primitives implemented in terms of GLib, they weren't marked as recursive, although that might be because marking them as recursive hadn't been invented yet.
Comment 4 Simon McVittie 2012-02-21 08:50:48 UTC
(In reply to comment #1)
> add API to check whether mutexes are going to be recursive

Unnecessary since 1.5.10, where we require recursive mutexes and use them for most things.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.