summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
authorJohan Hedberg <johan.hedberg@nokia.com>2006-08-04 08:55:50 +0000
committerJohan Hedberg <johan.hedberg@nokia.com>2006-08-04 08:55:50 +0000
commit70bbff923c930053ab15601023bdc12ba0258077 (patch)
treeb97fa301fcc61c1f00f99177b77b30cff3ff0c00 /hcid
parent7469e3053987868c478ceb62d13364a23c57cc17 (diff)
Use D-Bus dispatch status function instead of wakeup function. Seems to fix at least one deadlock issue when dbus threads are enabled.
Diffstat (limited to 'hcid')
-rw-r--r--hcid/dbus.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/hcid/dbus.c b/hcid/dbus.c
index b1bb5e2f..206d3343 100644
--- a/hcid/dbus.c
+++ b/hcid/dbus.c
@@ -1472,12 +1472,14 @@ static void timeout_toggled(DBusTimeout *timeout, void *data)
remove_timeout(timeout, data);
}
-static void wakeup_main_cb(void *data)
+static void dispatch_status_cb(DBusConnection *conn,
+ DBusDispatchStatus new_status,
+ void *data)
{
- if (!dbus_connection_get_is_connected(connection))
- return;
+ if (!dbus_connection_get_is_connected(conn))
+ return;
- if (dbus_connection_get_dispatch_status(connection) == DBUS_DISPATCH_DATA_REMAINS)
+ if (new_status == DBUS_DISPATCH_DATA_REMAINS)
g_timeout_add(DISPATCH_TIMEOUT, message_dispatch_cb, NULL);
}
@@ -1525,8 +1527,8 @@ int hcid_dbus_init(void)
dbus_connection_set_timeout_functions(connection,
add_timeout, remove_timeout, timeout_toggled, NULL, NULL);
- dbus_connection_set_wakeup_main_function(connection,
- wakeup_main_cb, NULL, NULL);
+ dbus_connection_set_dispatch_status_function(connection,
+ dispatch_status_cb, NULL, NULL);
return 0;
}