Cancellable
GCancellable
allows operations to be cancelled.
GCancellable
is a thread-safe operation cancellation stack used throughout GIO to allow for cancellation of synchronous and asynchronous operations.
Constructors
Functions
Emitted when the operation has been cancelled.
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 #GCancellable::cancelled signal handler will therefore result in a deadlock.
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().
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.