[at-spi2-core] Add names to every timeout
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-core] Add names to every timeout
- Date: Tue, 6 Jan 2015 00:19:06 +0000 (UTC)
commit f3f73dbcc2a2a0fe58a630d55e64512302d32cad
Author: Bastien Nocera <hadess hadess net>
Date: Tue Oct 22 14:13:38 2013 +0200
Add names to every timeout
https://bugzilla.gnome.org/show_bug.cgi?id=710644
registryd/deviceeventcontroller-x11.c | 2 ++
registryd/deviceeventcontroller.c | 26 +++++++++++++++++++-------
registryd/event-source.c | 1 +
test/memory.c | 8 ++++++--
4 files changed, 28 insertions(+), 9 deletions(-)
---
diff --git a/registryd/deviceeventcontroller-x11.c b/registryd/deviceeventcontroller-x11.c
index d878d53..5c2cf89 100644
--- a/registryd/deviceeventcontroller-x11.c
+++ b/registryd/deviceeventcontroller-x11.c
@@ -237,6 +237,7 @@ spi_dec_x11_get_keycode (SpiDEController *controller,
* Long-term fix is to extend the X keymap here instead of replace entries.
*/
priv->reserved_reset_timeout = g_timeout_add (500, spi_dec_reset_reserved, priv);
+ g_source_set_name_by_id (priv->reserved_reset_timeout, "[at-spi2-core]
spi_dec_reset_reserved");
}
if (modmask)
*modmask = 0;
@@ -1373,6 +1374,7 @@ wait_for_release_event (XEvent *event,
{
pressed_event = spi_keystroke_from_x_key_event ((XKeyEvent *) event);
check_release_handler = g_timeout_add (CHECK_RELEASE_DELAY, check_release, &pressed_event);
+ g_source_set_name_by_id (check_release_handler, "[at-spi2-core] check_release");
}
static void
diff --git a/registryd/deviceeventcontroller.c b/registryd/deviceeventcontroller.c
index 6d04a27..8279a1d 100644
--- a/registryd/deviceeventcontroller.c
+++ b/registryd/deviceeventcontroller.c
@@ -380,7 +380,9 @@ spi_dec_poll_mouse_idle (gpointer data)
return TRUE;
else
{
- g_timeout_add (20, spi_dec_poll_mouse_moving, data);
+ guint id;
+ id = g_timeout_add (20, spi_dec_poll_mouse_moving, data);
+ g_source_set_name_by_id (id, "[at-spi2-core] spi_dec_poll_mouse_moving");
return FALSE;
}
}
@@ -394,7 +396,9 @@ spi_dec_poll_mouse_moving (gpointer data)
return TRUE;
else
{
- g_timeout_add (100, spi_dec_poll_mouse_idle, data);
+ guint id;
+ id = g_timeout_add (100, spi_dec_poll_mouse_idle, data);
+ g_source_set_name_by_id (id, "[at-spi2-core] check_release");
return FALSE;
}
}
@@ -824,8 +828,11 @@ spi_controller_register_device_listener (SpiDEController *controller,
if (!have_mouse_listener)
{
have_mouse_listener = TRUE;
- if (!have_mouse_event_listener)
- g_timeout_add (100, spi_dec_poll_mouse_idle, controller);
+ if (!have_mouse_event_listener) {
+ guint id;
+ id = g_timeout_add (100, spi_dec_poll_mouse_idle, controller);
+ g_source_set_name_by_id (id, "[at-spi2-core] spi_dec_poll_mouse_idle");
+ }
}
spi_dbus_add_disconnect_match (controller->bus, listener->bus_name);
notify_mouse_listener (controller, listener, TRUE);
@@ -1988,8 +1995,10 @@ handle_dec_method (DBusConnection *bus, DBusMessage *message, void *user_data)
dbus_message_ref (message);
g_queue_push_tail (saved_controller->message_queue, message);
g_queue_push_tail (saved_controller->message_queue, user_data);
- if (!saved_controller->message_queue_idle)
+ if (!saved_controller->message_queue_idle) {
saved_controller->message_queue_idle = g_idle_add (message_queue_dispatch, NULL);
+ g_source_set_name_by_id (saved_controller->message_queue_idle, "[at-spi2-core] message_queue_dispatch");
+ }
return DBUS_HANDLER_RESULT_HANDLED;
}
@@ -2020,8 +2029,11 @@ spi_device_event_controller_start_poll_mouse (SpiRegistry *registry)
if (!have_mouse_event_listener)
{
have_mouse_event_listener = TRUE;
- if (!have_mouse_listener)
- g_timeout_add (100, spi_dec_poll_mouse_idle, registry->dec);
+ if (!have_mouse_listener) {
+ guint id;
+ id = g_timeout_add (100, spi_dec_poll_mouse_idle, registry->dec);
+ g_source_set_name_by_id (id, "[at-spi2-core] spi_dec_poll_mouse_idle");
+ }
}
}
diff --git a/registryd/event-source.c b/registryd/event-source.c
index b8dcff8..9ad3ec5 100644
--- a/registryd/event-source.c
+++ b/registryd/event-source.c
@@ -112,6 +112,7 @@ display_source_new (Display *display)
{
GSource *source = g_source_new (&event_funcs, sizeof (DisplaySource));
DisplaySource *display_source = (DisplaySource *) source;
+ g_source_set_name (source, "[at-spi2-core] display_source_funcs");
display_source->display = display;
diff --git a/test/memory.c b/test/memory.c
index 75cdd93..df5e0a1 100644
--- a/test/memory.c
+++ b/test/memory.c
@@ -53,13 +53,17 @@ on_event (AtspiEvent *event, void *data)
if (strstr (event->type, "add"))
{
AtspiAccessible *desktop = atspi_get_desktop (0);
+ guint id;
basic (desktop);
g_object_unref (desktop);
- g_timeout_add (3000, kill_child, NULL);
+ id = g_timeout_add (3000, kill_child, NULL);
+ g_source_set_name_by_id (id, "[at-spi2-core] kill_child");
}
else
{
- g_idle_add (end, NULL);
+ guint id;
+ id = g_idle_add (end, NULL);
+ g_source_set_name_by_id (id, "[at-spi2-core] end");
}
}
g_boxed_free (ATSPI_TYPE_EVENT, event);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]