gio: Add names to idles and timeouts

This isn't too useful for some of the "return result in idle"
functions, but it's better than nothing.

https://bugzilla.gnome.org/show_bug.cgi?id=726872
This commit is contained in:
Bastien Nocera 2014-03-22 13:15:45 +01:00
parent e1dee398bf
commit 8792609e15
13 changed files with 28 additions and 1 deletions

View File

@ -238,6 +238,7 @@ g_action_group_exporter_set_events (GActionGroupExporter *exporter,
source = g_idle_source_new ();
exporter->pending_source = source;
g_source_set_callback (source, g_action_group_exporter_dispatch_events, exporter, NULL);
g_source_set_name (source, "[gio] g_action_group_exporter_dispatch_events");
g_source_attach (source, exporter->context);
g_source_unref (source);
}

View File

@ -1238,6 +1238,7 @@ g_app_info_monitor_fire (void)
idle = g_idle_source_new ();
g_source_set_callback (idle, g_app_info_monitor_emit, context, NULL);
g_source_set_name (idle, "[gio] g_app_info_monitor_emit");
g_source_attach (idle, context);
g_source_unref (idle);
}

View File

@ -2520,13 +2520,14 @@ class CodeGenerator:
' skeleton->priv->changed_properties_idle_source = g_idle_source_new ();\n'
' g_source_set_priority (skeleton->priv->changed_properties_idle_source, G_PRIORITY_DEFAULT);\n'
' g_source_set_callback (skeleton->priv->changed_properties_idle_source, _%s_emit_changed, g_object_ref (skeleton), (GDestroyNotify) g_object_unref);\n'
' g_source_set_name (skeleton->priv->changed_properties_idle_source, "[generated] _%s_emit_changed");\n'
' g_source_attach (skeleton->priv->changed_properties_idle_source, skeleton->priv->context);\n'
' g_source_unref (skeleton->priv->changed_properties_idle_source);\n'
' }\n'
' g_mutex_unlock (&skeleton->priv->lock);\n'
'}\n'
'\n'
%(i.name_lower, i.camel_name, i.ns_upper, i.name_upper, i.name_lower))
%(i.name_lower, i.camel_name, i.ns_upper, i.name_upper, i.name_lower, i.name_lower))
self.c.write('static void\n'
'%s_skeleton_set_property (GObject *object,\n'

View File

@ -281,6 +281,7 @@ call_destroy_notify (GMainContext *context,
call_destroy_notify_data_in_idle,
data,
(GDestroyNotify) call_destroy_notify_data_free);
g_source_set_name (idle_source, "[gio] call_destroy_notify_data_in_idle");
g_source_attach (idle_source, data->context);
g_source_unref (idle_source);
@ -1415,6 +1416,7 @@ schedule_closed_unlocked (GDBusConnection *connection,
emit_closed_in_idle,
data,
(GDestroyNotify) emit_closed_data_free);
g_source_set_name (idle_source, "[gio] emit_closed_in_idle");
g_source_attach (idle_source, connection->main_context_at_construction);
g_source_unref (idle_source);
}
@ -1917,6 +1919,7 @@ send_message_with_reply_cancelled_cb (GCancellable *cancellable,
send_message_with_reply_cancelled_idle_cb,
send_message_data_ref (data),
(GDestroyNotify) send_message_data_unref);
g_source_set_name (idle_source, "[gio] send_message_with_reply_cancelled_idle_cb");
g_source_attach (idle_source, data->main_context);
g_source_unref (idle_source);
}
@ -3902,6 +3905,7 @@ schedule_callbacks (GDBusConnection *connection,
emit_signal_instance_in_idle_cb,
signal_instance,
(GDestroyNotify) signal_instance_free);
g_source_set_name (idle_source, "[gio] emit_signal_instance_in_idle_cb");
g_source_attach (idle_source, subscriber->context);
g_source_unref (idle_source);
}
@ -4392,6 +4396,10 @@ validate_and_maybe_schedule_property_getset (GDBusConnection *connect
is_get ? invoke_get_property_in_idle_cb : invoke_set_property_in_idle_cb,
property_data,
(GDestroyNotify) property_data_free);
if (is_get)
g_source_set_name (idle_source, "[gio] invoke_get_property_in_idle_cb");
else
g_source_set_name (idle_source, "[gio] invoke_set_property_in_idle_cb");
g_source_attach (idle_source, main_context);
g_source_unref (idle_source);
@ -4609,6 +4617,7 @@ validate_and_maybe_schedule_property_get_all (GDBusConnection *connec
invoke_get_all_properties_in_idle_cb,
property_get_all_data,
(GDestroyNotify) property_get_all_data_free);
g_source_set_name (idle_source, "[gio] invoke_get_all_properties_in_idle_cb");
g_source_attach (idle_source, main_context);
g_source_unref (idle_source);
@ -4925,6 +4934,7 @@ schedule_method_call (GDBusConnection *connection,
call_in_idle_cb,
invocation,
g_object_unref);
g_source_set_name (idle_source, "[gio] call_in_idle_cb");
g_source_attach (idle_source, main_context);
g_source_unref (idle_source);
}
@ -6500,6 +6510,7 @@ subtree_message_func (GDBusConnection *connection,
process_subtree_vtable_message_in_idle_cb,
data,
(GDestroyNotify) subtree_deferred_data_free);
g_source_set_name (idle_source, "[gio] process_subtree_vtable_message_in_idle_cb");
g_source_attach (idle_source, es->context);
g_source_unref (idle_source);

View File

@ -197,6 +197,7 @@ schedule_call_in_idle (Client *client, CallType call_type)
call_in_idle_cb,
data,
(GDestroyNotify) call_handler_data_free);
g_source_set_name (idle_source, "[gio] call_in_idle_cb");
g_source_attach (idle_source, client->main_context);
g_source_unref (idle_source);
}

View File

@ -198,6 +198,7 @@ schedule_call_in_idle (Client *client, CallType call_type)
call_in_idle_cb,
data,
(GDestroyNotify) call_handler_data_free);
g_source_set_name (idle_source, "[gio] call_in_idle_cb");
g_source_attach (idle_source, client->main_context);
g_source_unref (idle_source);
}

View File

@ -554,6 +554,7 @@ _g_dbus_worker_unfreeze (GDBusWorker *worker)
unfreeze_in_idle_cb,
_g_dbus_worker_ref (worker),
(GDestroyNotify) _g_dbus_worker_unref);
g_source_set_name (idle_source, "[gio] unfreeze_in_idle_cb");
g_source_attach (idle_source, worker->shared_thread_data->context);
g_source_unref (idle_source);
}
@ -1596,6 +1597,7 @@ schedule_writing_unlocked (GDBusWorker *worker,
continue_writing_in_idle_cb,
_g_dbus_worker_ref (worker),
(GDestroyNotify) _g_dbus_worker_unref);
g_source_set_name (idle_source, "[gio] continue_writing_in_idle_cb");
g_source_attach (idle_source, worker->shared_thread_data->context);
g_source_unref (idle_source);
}
@ -1681,6 +1683,7 @@ _g_dbus_worker_new (GIOStream *stream,
_g_dbus_worker_do_initial_read,
_g_dbus_worker_ref (worker),
(GDestroyNotify) _g_dbus_worker_unref);
g_source_set_name (idle_source, "[gio] _g_dbus_worker_do_initial_read");
g_source_attach (idle_source, worker->shared_thread_data->context);
g_source_unref (idle_source);

View File

@ -1012,6 +1012,7 @@ on_run (GSocketService *service,
emit_new_connection_in_idle,
data,
(GDestroyNotify) emit_idle_data_free);
g_source_set_name (idle_source, "[gio] emit_new_connection_in_idle");
g_source_attach (idle_source, server->main_context_at_construction);
g_source_unref (idle_source);
}

View File

@ -443,6 +443,7 @@ emit_in_idle (GFileMonitor *monitor,
* pending idles.
*/
g_source_set_callback (source, emit_cb, monitor, NULL);
g_source_set_name (source, "[gio] emit_cb");
g_source_attach (source, monitor->priv->context);
}
/* We reverse this in the processor */

View File

@ -258,6 +258,7 @@ g_io_scheduler_job_send_to_mainloop (GIOSchedulerJob *job,
g_source_set_priority (source, G_PRIORITY_DEFAULT);
g_source_set_callback (source, mainloop_proxy_func, proxy,
NULL);
g_source_set_name (source, "[gio] mainloop_proxy_func");
g_source_attach (source, job->context);
g_source_unref (source);
@ -314,6 +315,7 @@ g_io_scheduler_job_send_to_mainloop_async (GIOSchedulerJob *job,
g_source_set_priority (source, G_PRIORITY_DEFAULT);
g_source_set_callback (source, mainloop_proxy_func, proxy,
(GDestroyNotify)mainloop_proxy_free);
g_source_set_name (source, "[gio] mainloop_proxy_func");
g_source_attach (source, job->context);
g_source_unref (source);

View File

@ -379,6 +379,7 @@ queue_network_changed (GNetworkMonitorBase *monitor)
*/
g_source_set_priority (source, G_PRIORITY_HIGH_IDLE);
g_source_set_callback (source, emit_network_changed, monitor, NULL);
g_source_set_name (source, "[gio] emit_network_changed");
g_source_attach (source, monitor->priv->context);
monitor->priv->network_changed_source = source;
}

View File

@ -801,6 +801,7 @@ g_simple_async_result_complete_in_idle (GSimpleAsyncResult *simple)
source = g_idle_source_new ();
g_source_set_priority (source, G_PRIORITY_DEFAULT);
g_source_set_callback (source, complete_in_idle_cb, simple, g_object_unref);
g_source_set_name (source, "[gio] complete_in_idle_cb");
g_source_attach (source, simple->context);
g_source_unref (source);
@ -861,6 +862,7 @@ run_in_thread (GIOSchedulerJob *job,
source = g_idle_source_new ();
g_source_set_priority (source, G_PRIORITY_DEFAULT);
g_source_set_callback (source, complete_in_idle_cb_for_thread, data, NULL);
g_source_set_name (source, "[gio] complete_in_idle_cb_for_thread");
g_source_attach (source, simple->context);
g_source_unref (source);

View File

@ -1135,6 +1135,7 @@ g_task_return (GTask *task,
/* Otherwise, complete in the next iteration */
source = g_idle_source_new ();
g_task_attach_source (task, source, complete_in_idle_cb);
g_source_set_name (source, "[gio] complete_in_idle_cb");
g_source_unref (source);
}