Gio.TaskThreadFunc

function onTaskThreadFunc(task: Gio.Task, source_object: GObject.Object, task_data: void, cancellable: Gio.Cancellable): void {
}
  

The prototype for a task function to be run in a thread via Gio.Task.run_in_thread or Gio.Task.run_in_thread_sync.

If the return-on-cancel flag is set on task, and cancellable gets cancelled, then the Gio.Task will be completed immediately (as though Gio.Task.prototype.return_error_if_cancelled had been called), without waiting for the task function to complete. However, the task function will continue running in its thread in the background. The function therefore needs to be careful about how it uses externally-visible state in this case. See Gio.Task.prototype.set_return_on_cancel for more details.

Other than in that case, task will be completed when the Gio.TaskThreadFunc returns, not when it calls a `g_task_return_` function.

Since 2.36

task

the Gio.Task

source_object

task's source object

task_data

task's task data

cancellable

task's Gio.Cancellable, or null