### Method

# Gio Task set_check_cancellable

since: 2.36

#### Declaration

    void
    g_task_set_check_cancellable (
      GTask* task,
      gboolean check_cancellable
    )

#### Description

Sets or clears `task`‘s check-cancellable flag. If this is `TRUE` (the default), then g_task_propagate_pointer(), etc, and `g_task_had_error()` will check the task’s `GCancellable` first, and if it has been cancelled, then they will consider the task to have returned an “Operation was cancelled” error (`G_IO_ERROR_CANCELLED`), regardless of any other error or return value the task may have had.

If `check_cancellable` is `FALSE`, then the `GTask` will not check the cancellable itself, and it is up to `task`‘s owner to do this (eg, via g_task_return_error_if_cancelled()).

If you are using `g_task_set_return_on_cancel()` as well, then you must leave check-cancellable set `TRUE`.

Available since: 2.36

#### Parameters

`check_cancellable`

  Type: `gboolean`

  Whether `GTask` will check the state of its `GCancellable` for you.