mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
gtask: Add a g_task_set_name() method
Similarly to g_source_set_name(), this sets a name on a GTask for debugging and profiling. Importantly, this name is propagated to the GSource for idle callbacks for the GTask, ending the glorious reign of `[gio] complete_in_idle_cb`. The name can be queried using g_task_get_name(). Locking is avoided by only allowing the name to be set before the GTask is used from another thread. Includes tests. Signed-off-by: Philip Withnall <withnall@endlessm.com>
This commit is contained in:
@@ -74,6 +74,9 @@ void g_task_set_check_cancellable (GTask *task,
|
||||
GLIB_AVAILABLE_IN_2_36
|
||||
void g_task_set_source_tag (GTask *task,
|
||||
gpointer source_tag);
|
||||
GLIB_AVAILABLE_IN_2_60
|
||||
void g_task_set_name (GTask *task,
|
||||
const gchar *name);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_36
|
||||
gpointer g_task_get_source_object (GTask *task);
|
||||
@@ -89,6 +92,8 @@ GLIB_AVAILABLE_IN_2_36
|
||||
gboolean g_task_get_check_cancellable (GTask *task);
|
||||
GLIB_AVAILABLE_IN_2_36
|
||||
gpointer g_task_get_source_tag (GTask *task);
|
||||
GLIB_AVAILABLE_IN_2_60
|
||||
const gchar *g_task_get_name (GTask *task);
|
||||
|
||||
GLIB_AVAILABLE_IN_2_36
|
||||
gboolean g_task_is_valid (gpointer result,
|
||||
|
Reference in New Issue
Block a user