Sending new messages from a signal handler
hp at pobox.com
Thu Dec 4 14:22:58 PST 2008
The docs currently read "Be careful about calling
dbus_connection_dispatch() from inside a message handler, i.e. calling
dbus_connection_dispatch() recursively. If threads have been
initialized with a recursive mutex function, then this will not
deadlock; however, it can certainly confuse your application."
Reading code, the mutex in DBusConnection appears to be dropped when
calling out to application handlers. But I don't remember why we added
recursive mutexes if that's the case. Doesn't make sense.
Some unenlightening historical thread:
I think there's probably a more-enlightening old email but I can't find it.
I would suggest getting a backtrace from your deadlock and that will
help us all understand the exact problem.
(side note: recursive dispatch, or as it sounds like you're doing, a
recursive mainloop, can be extremely dangerous and unpredictable, even
if we make it not deadlock)
More information about the dbus