signal callback delegate or function to connect
void callback(gio.cancellable.Cancellable cancellable)
cancellable the instance the signal is connected to (optional)
Yes.After to execute callback after default handler, No.After to execute before (default)
Signal ID
Connect to Cancelled signal.
Emitted when the operation has been cancelled.
Can be used by implementations of cancellable operations. If the operation is cancelled from another thread, the signal will be emitted in the thread that cancelled the operation, not the thread that is running the operation.
Note that disconnecting from this signal (or any signal) in a multi-threaded program is prone to race conditions. For instance it is possible that a signal handler may be invoked even after a call to gobject.global.signalHandlerDisconnect for that handler has already returned.
There is also a problem when cancellation happens right before connecting to the signal. If this happens the signal will unexpectedly not be emitted, and checking before connecting to the signal leaves a race condition where this is still happening.
In order to make it safe and easy to connect handlers there are two helper functions: gio.cancellable.Cancellable.connect and gio.cancellable.Cancellable.disconnect which protect against problems like this.
An example of how to us this:
Note that the cancelled signal is emitted in the thread that the user cancelled from, which may be the main thread. So, the cancellable signal should not do something that can block.