[at-spi2-core] Don't call dbus_connection_dispatch recursively
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core] Don't call dbus_connection_dispatch recursively
- Date: Mon, 2 Sep 2013 17:48:16 +0000 (UTC)
commit c40e7c6ce7f5686fa6f5765103727a6e69112c5a
Author: Mike Gorse <mgorse suse com>
Date: Mon Sep 2 12:28:27 2013 -0500
Don't call dbus_connection_dispatch recursively
dbus_connection_dispatch is trying to lock the connection when it is
already locked, resulting in a deadlock, so just don't call it
recursively for now.
dbind/dbind.c | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/dbind/dbind.c b/dbind/dbind.c
index f10b9cd..d85a9e5 100644
--- a/dbind/dbind.c
+++ b/dbind/dbind.c
@@ -68,14 +68,19 @@ dbind_send_and_allow_reentry (DBusConnection * bus, DBusMessage * message, DBusE
const char *destination = dbus_message_get_destination (message);
struct timeval tv;
DBusMessage *ret;
+ static gboolean in_dispatch = FALSE;
if (unique_name && destination &&
strcmp (destination, unique_name) != 0)
{
ret = dbus_connection_send_with_reply_and_block (bus, message,
dbind_timeout, error);
- if (g_main_depth () == 0)
- while (dbus_connection_dispatch (bus) == DBUS_DISPATCH_DATA_REMAINS);
+ if (g_main_depth () == 0 && !in_dispatch)
+ {
+ in_dispatch = TRUE;
+ while (dbus_connection_dispatch (bus) == DBUS_DISPATCH_DATA_REMAINS);
+ in_dispatch = FALSE;
+ }
return ret;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]