Gio.Cancellable.disconnect

### Method

# Gio Cancellabledisconnect

since: 2.22

#### Declaration [src]

    void
    g_cancellable_disconnect (
      GCancellable* cancellable,
      gulong handler_id
    )

#### Description [src]

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.

This avoids a race condition where a thread cancels at the same time as the cancellable operation is finished and the signal handler is removed. See `GCancellable::cancelled` for details on how to use this.

If `cancellable` is `NULL` or `handler_id` is `0` this function does nothing.

Available since: 2.22

#### Parameters

`cancellable`

  Type: `GCancellable`

  A `GCancellable` or `NULL`.

  The argument can be `NULL`.

`handler_id`

  Type: `gulong`

  Handler id of the handler to be disconnected, or `0`.