GCancellable is a thread-safe operation cancellation stack used throughout GIO to allow for cancellation of synchronous and asynchronous operations.
Sets our main struct and passes it to the parent class.
Creates a new GCancellable object.
Emitted when the operation has been cancelled.
Will set cancellable to cancelled, and will emit the cancelled signal. (However, see the warning about race conditions in the documentation for that signal if you are planning to connect to it.)
Convenience function to connect to the cancelled signal. Also handles the race condition that may happen if the cancellable is cancelled right before connecting.
Disconnects a handler from a cancellable instance similar to g_signal_handler_disconnect(). Additionally, in the event that a signal handler is currently running, this call will block until the handler has finished. Calling this function from a cancelled signal handler will therefore result in a deadlock.
Get the main Gtk struct
Gets the file descriptor for a cancellable job. This can be used to implement cancellable operations on Unix systems. The returned fd will turn readable when cancellable is cancelled.
the main Gtk struct as a void*
Checks if a cancellable job has been cancelled.
Creates a GPollFD corresponding to cancellable; this can be passed to g_poll() and used to poll for cancellation. This is useful both for unix systems without a native poll and for portability to windows.
Pops cancellable off the cancellable stack (verifying that cancellable is on the top of the stack).
Pushes cancellable onto the cancellable stack. The current cancellable can then be received using g_cancellable_get_current().
Releases a resources previously allocated by g_cancellable_get_fd() or g_cancellable_make_pollfd().
Resets cancellable to its uncancelled state.
If the cancellable is cancelled, sets the error to notify that the operation was cancelled.
Creates a source that triggers if cancellable is cancelled and calls its callback of type GCancellableSourceFunc This is primarily useful for attaching to another (non-cancellable) source with g_source_add_child_source() to add cancellability to it.
the main Gtk struct