Document that _finish() must be called at most once.

The patch was provided by Will Thompson in bug 602417.
This commit is contained in:
Matthias Clasen 2010-01-02 19:44:26 -05:00
parent 74af99b860
commit f58fa69343

View File

@ -42,19 +42,19 @@
* filled with the details of the operation's success or failure, the * filled with the details of the operation's success or failure, the
* object the asynchronous function was started for and any error codes * object the asynchronous function was started for and any error codes
* returned. The asynchronous callback function is then expected to call * returned. The asynchronous callback function is then expected to call
* the corresponding "_finish()" function with the object the function * the corresponding "_finish()" function, passing the object the
* was called for, and the #GAsyncResult instance, and optionally, * function was called for, the #GAsyncResult instance, and (optionally)
* an @error to grab any error conditions that may have occurred. * an @error to grab any error conditions that may have occurred.
* *
* The purpose of the "_finish()" function is to take the generic * The "_finish()" function for an operation takes the generic result
* result of type #GAsyncResult and return the specific result * (of type #GAsyncResult) and returns the specific result that the
* that the operation in question yields (e.g. a #GFileEnumerator for * operation in question yields (e.g. a #GFileEnumerator for a
* a "enumerate children" operation). If the result or error status * "enumerate children" operation). If the result or error status of the
* of the operation is not needed, there is no need to call the * operation is not needed, there is no need to call the "_finish()"
* "_finish()" function, GIO will take care of cleaning up the * function; GIO will take care of cleaning up the result and error
* result and error information after the #GAsyncReadyCallback * information after the #GAsyncReadyCallback returns. Applications may
* returns. It is also allowed to take a reference to the #GAsyncResult * also take a reference to the #GAsyncResult and call "_finish()"
* and call "_finish()" later. * later; however, the "_finish()" function may be called at most once.
* *
* Example of a typical asynchronous operation flow: * Example of a typical asynchronous operation flow:
* |[ * |[