[ CCode ( has_target = false ) ]
[ Version ( since = "2.36" ) ]
public delegate void TaskThreadFunc (Task task, Object source_object, void* task_data, Cancellable? cancellable = null)

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

If the return-on-cancel flag is set on task, and cancellable gets cancelled, then the Task will be completed immediately (as though 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 set_return_on_cancel for more details.

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



the Task


task's source object


task's task data


task's Cancellable, or null

Namespace: GLib
Package: gio-2.0