gtask: Add a GTask:completed property

This can be used to query whether the task has completed, in the sense
that it has had a result set on it, and has already – or will soon –
invoke its callback function.

Notifications for this property are emitted immediately after the task’s
main callback, in the same main context as that callback. This allows
for multiple bits of code to listen for completion of the GTask, which
opens the door for blocking on cancellation of the GTask and improved
handling of ‘pending’ behaviour.

https://bugzilla.gnome.org/show_bug.cgi?id=743636
This commit is contained in:
Philip Withnall
2014-08-21 19:04:04 +01:00
parent e83f9e5254
commit 4f1f68e6be
4 changed files with 245 additions and 21 deletions

View File

@@ -152,6 +152,8 @@ gssize g_task_propagate_int (GTask *task,
GError **error);
GLIB_AVAILABLE_IN_2_36
gboolean g_task_had_error (GTask *task);
GLIB_AVAILABLE_IN_2_44
gboolean g_task_get_completed (GTask *task);
G_END_DECLS