[ Version ( since = "2.36" ) ]
public void run_in_thread (TaskThreadFunc task_func)

Runs task_func in another thread.

When task_func returns, this's TaskReadyCallback will be invoked in this's MainContext.

This takes a ref on this until the task completes.

See TaskThreadFunc for more details about how task_func is handled.

Although GLib currently rate-limits the tasks queued via run_in_thread, you should not assume that it will always do this. If you have a very large number of tasks to run (several tens of tasks), but don't want them to all run at once, you should only queue a limited number of them (around ten) at a time.



a Task


a TaskThreadFunc