GCancellable: add g_cancellable_create_source()

g_cancellable_create_source() returns a GSource that triggers when its
corresponding GCancellable is cancelled. This can be used with
g_source_add_child_source() to add cancellability to a source.

Port gasynchelper's FDSource to use this rather than doing its own
cancellable handling, and also fix up its callback argument order to
be more normal.

https://bugzilla.gnome.org/show_bug.cgi?id=634239
This commit is contained in:
Dan Winship
2010-11-06 15:49:55 -04:00
parent d15cdbefec
commit 6181c7de36
6 changed files with 146 additions and 37 deletions

View File

@@ -193,6 +193,7 @@ g_cancellable_reset
g_cancellable_cancel
g_cancellable_connect
g_cancellable_disconnect
g_cancellable_source_new
#endif
#endif