mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-09-05 23:48:44 +02:00
gtask: Improve task names used internally within GLib
And improve them externally, where not otherwise set, by setting them from the function name passed to `g_task_set_source_tag()`, if called by third party code. This should make profiling and debug output from GLib more useful. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
@@ -759,6 +759,7 @@ g_task_report_error (gpointer source_object,
|
||||
|
||||
task = g_task_new (source_object, NULL, callback, callback_data);
|
||||
g_task_set_source_tag (task, source_tag);
|
||||
g_task_set_name (task, G_STRFUNC);
|
||||
g_task_return_error (task, error);
|
||||
g_object_unref (task);
|
||||
}
|
||||
@@ -982,8 +983,8 @@ g_task_set_return_on_cancel (GTask *task,
|
||||
* Since: 2.36
|
||||
*/
|
||||
void
|
||||
g_task_set_source_tag (GTask *task,
|
||||
gpointer source_tag)
|
||||
(g_task_set_source_tag) (GTask *task,
|
||||
gpointer source_tag)
|
||||
{
|
||||
g_return_if_fail (G_IS_TASK (task));
|
||||
|
||||
|
Reference in New Issue
Block a user