mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
docs: Don't be vague about where GTask dispatches the result
https://bugzilla.gnome.org/show_bug.cgi?id=783825
This commit is contained in:
parent
3c5b59ddca
commit
61ea1e7ca4
19
gio/gtask.c
19
gio/gtask.c
@ -47,11 +47,13 @@
|
|||||||
* Eventually, you will call a method such as
|
* Eventually, you will call a method such as
|
||||||
* g_task_return_pointer() or g_task_return_error(), which will
|
* g_task_return_pointer() or g_task_return_error(), which will
|
||||||
* save the value you give it and then invoke the task's callback
|
* save the value you give it and then invoke the task's callback
|
||||||
* function (waiting until the next iteration of the main
|
* function in the
|
||||||
* loop first, if necessary). The caller will pass the #GTask back
|
* [thread-default main context][g-main-context-push-thread-default]
|
||||||
* to the operation's finish function (as a #GAsyncResult), and
|
* where it was created (waiting until the next iteration of the main
|
||||||
* you can use g_task_propagate_pointer() or the like to extract
|
* loop first, if necessary). The caller will pass the #GTask back to
|
||||||
* the return value.
|
* 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:
|
* Here is an example for using GTask as a GAsyncResult:
|
||||||
* |[<!-- language="C" -->
|
* |[<!-- language="C" -->
|
||||||
@ -290,9 +292,10 @@
|
|||||||
* ## Asynchronous operations from synchronous ones
|
* ## Asynchronous operations from synchronous ones
|
||||||
*
|
*
|
||||||
* You can use g_task_run_in_thread() to turn a synchronous
|
* You can use g_task_run_in_thread() to turn a synchronous
|
||||||
* operation into an asynchronous one, by running it in a thread
|
* operation into an asynchronous one, by running it in a thread.
|
||||||
* which will then dispatch the result back to the caller's
|
* When it completes, the result will be dispatched to the
|
||||||
* #GMainContext when it completes.
|
* [thread-default main context][g-main-context-push-thread-default]
|
||||||
|
* where the #GTask was created.
|
||||||
*
|
*
|
||||||
* Running a task in a thread:
|
* Running a task in a thread:
|
||||||
* |[<!-- language="C" -->
|
* |[<!-- language="C" -->
|
||||||
|
Loading…
Reference in New Issue
Block a user