diff options
Diffstat (limited to 'gio/gtask.c')
-rw-r--r-- | gio/gtask.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/gio/gtask.c b/gio/gtask.c index 7eb018560..814ba9433 100644 --- a/gio/gtask.c +++ b/gio/gtask.c @@ -47,11 +47,13 @@ * Eventually, you will call a method such as * g_task_return_pointer() or g_task_return_error(), which will * save the value you give it and then invoke the task's callback - * function (waiting until the next iteration of the main - * loop first, if necessary). The caller will pass the #GTask back - * to the operation's finish function (as a #GAsyncResult), and - * you can use g_task_propagate_pointer() or the like to extract - * the return value. + * function in the + * [thread-default main context][g-main-context-push-thread-default] + * where it was created (waiting until the next iteration of the main + * loop first, if necessary). The caller will pass the #GTask back to + * the operation's finish function (as a #GAsyncResult), and you can + * can use g_task_propagate_pointer() or the like to extract the + * return value. * * Here is an example for using GTask as a GAsyncResult: * |[<!-- language="C" --> @@ -290,9 +292,10 @@ * ## Asynchronous operations from synchronous ones * * You can use g_task_run_in_thread() to turn a synchronous - * operation into an asynchronous one, by running it in a thread - * which will then dispatch the result back to the caller's - * #GMainContext when it completes. + * operation into an asynchronous one, by running it in a thread. + * When it completes, the result will be dispatched to the + * [thread-default main context][g-main-context-push-thread-default] + * where the #GTask was created. * * Running a task in a thread: * |[<!-- language="C" --> @@ -504,7 +507,7 @@ * whether the task's callback can be invoked directly, or * if it needs to be sent to another #GMainContext, or delayed * until the next iteration of the current #GMainContext.) - * - The "finish" functions for #GTask-based operations are generally + * - The "finish" functions for #GTask based operations are generally * much simpler than #GSimpleAsyncResult ones, normally consisting * of only a single call to g_task_propagate_pointer() or the like. * Since g_task_propagate_pointer() "steals" the return value from @@ -978,7 +981,7 @@ g_task_set_source_tag (GTask *task, * Gets the source object from @task. Like * g_async_result_get_source_object(), but does not ref the object. * - * Returns: (transfer none) (type GObject): @task's source object, or %NULL + * Returns: (transfer none) (nullable) (type GObject): @task's source object, or %NULL * * Since: 2.36 */ |