gio: GCancellable can be used concurrently

* Update documentation to note that GCancellable can be used
   concurrently by multiple operations.
 * Add documentation to g_cancellable_reset that behavior is
   undefined if called from within cancelled handler.
 * Add test for multiple concurrent operations using the same
   cancellable.

https://bugzilla.gnome.org/show_bug.cgi?id=656387
This commit is contained in:
Stef Walter
2011-08-12 11:49:31 +02:00
parent c3fd789bb7
commit 54579bf88f
4 changed files with 233 additions and 2 deletions

View File

@@ -171,7 +171,7 @@ g_cancellable_init (GCancellable *cancellable)
* and pass it to the operations.
*
* One #GCancellable can be used in multiple consecutive
* operations, but not in multiple concurrent operations.
* operations or in multiple concurrent operations.
*
* Returns: a #GCancellable.
**/
@@ -251,7 +251,10 @@ g_cancellable_get_current (void)
* g_cancellable_reset:
* @cancellable: a #GCancellable object.
*
* Resets @cancellable to its uncancelled state.
* Resets @cancellable to its uncancelled state.
*
* If cancellable is currently in use by any cancellable operation
* then the behavior of this function is undefined.
**/
void
g_cancellable_reset (GCancellable *cancellable)