GSimpleAsyncResult: support reliable cancellation

Add a function g_simple_async_result_set_check_cancellable() to provide
a GCancellable that is checked for being cancelled during the call to
g_simple_async_result_propagate_error().

This gives asynchronous operation implementations an easy way to
provide reliable cancellation of those operations -- even in the case
that a positive result has occured and is pending dispatch at the time
the operation is cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=672013
This commit is contained in:
Ryan Lortie
2012-03-13 16:09:01 -04:00
parent 53b1afba0e
commit 4804094472
4 changed files with 62 additions and 0 deletions

View File

@@ -1211,6 +1211,7 @@ g_simple_async_result_new
g_simple_async_result_new_error
g_simple_async_result_new_from_error
g_simple_async_result_new_take_error
g_simple_async_result_set_check_cancellable
g_simple_async_result_set_op_res_gpointer
g_simple_async_result_get_op_res_gpointer
g_simple_async_result_set_op_res_gssize