Commit 6f281ce2 authored by Philip Withnall's avatar Philip Withnall

gtask: Include task name in complete_in_idle_cb source name

`complete_in_idle_cb()` shows up in a lot of sysprof traces, so it’s
quite useful to include the most specific contextual information we can
in it.
Signed-off-by: Philip Withnall's avatarPhilip Withnall <>
parent bfe16174
......@@ -1241,6 +1241,7 @@ g_task_return (GTask *task,
GTaskReturnType type)
GSource *source;
gchar *source_name = NULL;
task->ever_returned = TRUE;
......@@ -1289,7 +1290,10 @@ g_task_return (GTask *task,
/* Otherwise, complete in the next iteration */
source = g_idle_source_new ();
g_source_set_name (source, "[gio] complete_in_idle_cb");
source_name = g_strdup_printf ("[gio] %s complete_in_idle_cb",
(task->name != NULL) ? task->name : "(unnamed)");
g_source_set_name (source, source_name);
g_free (source_name);
g_task_attach_source (task, source, complete_in_idle_cb);
g_source_unref (source);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment