[glib/glib-2-42] gcancellable: Mention nullability in g_cancellable_cancel() docs
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-42] gcancellable: Mention nullability in g_cancellable_cancel() docs
- Date: Thu, 26 Feb 2015 03:49:54 +0000 (UTC)
commit 9b19ce33385c8b185c95f216bf87197058e15ec1
Author: Philip Withnall <philip withnall collabora co uk>
Date: Tue Feb 24 10:57:14 2015 +0000
gcancellable: Mention nullability in g_cancellable_cancel() docs
Calling g_cancellable_cancel(NULL) is an explicitly allowed no-op, for
convenience. Document and annotate that.
gio/gcancellable.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gio/gcancellable.c b/gio/gcancellable.c
index 800e8f3..a089a82 100644
--- a/gio/gcancellable.c
+++ b/gio/gcancellable.c
@@ -458,7 +458,7 @@ g_cancellable_release_fd (GCancellable *cancellable)
/**
* g_cancellable_cancel:
- * @cancellable: a #GCancellable object.
+ * @cancellable: (nullable): a #GCancellable object.
*
* Will set @cancellable to cancelled, and will emit the
* #GCancellable::cancelled signal. (However, see the warning about
@@ -469,7 +469,9 @@ g_cancellable_release_fd (GCancellable *cancellable)
* it from a thread other than the one running the operation that was
* passed the @cancellable.
*
- * The convention within gio is that cancelling an asynchronous
+ * If @cancellable is %NULL, this function returns immediately for convenience.
+ *
+ * The convention within GIO is that cancelling an asynchronous
* operation causes it to complete asynchronously. That is, if you
* cancel the operation from the same thread in which it is running,
* then the operation's #GAsyncReadyCallback will not be invoked until
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]