mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-02 07:23:41 +02:00
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:
@@ -376,6 +376,21 @@ typedef struct _GDBusPropertyInfo GDBusPropertyInfo;
|
||||
typedef struct _GDBusInterfaceInfo GDBusInterfaceInfo;
|
||||
typedef struct _GDBusNodeInfo GDBusNodeInfo;
|
||||
|
||||
/**
|
||||
* GCancellableSourceFunc:
|
||||
* @cancellable: the #GCancellable
|
||||
* @user_data: data passed in by the user.
|
||||
*
|
||||
* This is the function type of the callback used for the #GSource
|
||||
* returned by g_cancellable_source_new().
|
||||
*
|
||||
* Returns: it should return %FALSE if the source should be removed.
|
||||
*
|
||||
* Since: 2.28
|
||||
*/
|
||||
typedef gboolean (*GCancellableSourceFunc) (GCancellable *cancellable,
|
||||
gpointer user_data);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
#endif /* __GIO_TYPES_H__ */
|
||||
|
Reference in New Issue
Block a user