mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-04 16:33:40 +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:
@@ -305,7 +305,8 @@ eject_mount_do (GVolume *volume,
|
||||
GCancellable *cancellable,
|
||||
GAsyncReadyCallback callback,
|
||||
gpointer user_data,
|
||||
const gchar * const *argv)
|
||||
const gchar * const *argv,
|
||||
const gchar *task_name)
|
||||
{
|
||||
GSubprocess *subprocess;
|
||||
GError *error = NULL;
|
||||
@@ -313,6 +314,7 @@ eject_mount_do (GVolume *volume,
|
||||
|
||||
task = g_task_new (volume, cancellable, callback, user_data);
|
||||
g_task_set_source_tag (task, eject_mount_do);
|
||||
g_task_set_name (task, task_name);
|
||||
|
||||
if (g_task_return_error_if_cancelled (task))
|
||||
{
|
||||
@@ -344,7 +346,7 @@ g_unix_volume_mount (GVolume *volume,
|
||||
else
|
||||
argv[1] = unix_volume->device_path;
|
||||
|
||||
eject_mount_do (volume, cancellable, callback, user_data, argv);
|
||||
eject_mount_do (volume, cancellable, callback, user_data, argv, "[gio] mount volume");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -369,7 +371,7 @@ g_unix_volume_eject (GVolume *volume,
|
||||
|
||||
argv[1] = unix_volume->device_path;
|
||||
|
||||
eject_mount_do (volume, cancellable, callback, user_data, argv);
|
||||
eject_mount_do (volume, cancellable, callback, user_data, argv, "[gio] eject volume");
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
Reference in New Issue
Block a user