[glib: 1/2] gthread: Add introspection annotations



commit 1cb2db8515fbe0ee6be74eb44f93f220bb795123
Author: Philip Withnall <withnall endlessm com>
Date:   Tue May 19 14:52:17 2020 +0100

    gthread: Add introspection annotations
    
    It’s not expected that bindings will use `GThread` over their own
    threading APIs (in fact that would generally be a bad idea, since
    threads benefit from being integrated into language control flow
    structures), but it can’t hurt to have the annotations right for
    documentation purposes if nothing else.
    
    Signed-off-by: Philip Withnall <withnall endlessm com>
    
    Fixes: #602

 glib/gthread.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)
---
diff --git a/glib/gthread.c b/glib/gthread.c
index 6531f70d7..cab0e8cbb 100644
--- a/glib/gthread.c
+++ b/glib/gthread.c
@@ -739,7 +739,7 @@ void
  *
  * Increase the reference count on @thread.
  *
- * Returns: a new reference to @thread
+ * Returns: (transfer full): a new reference to @thread
  *
  * Since: 2.32
  */
@@ -755,7 +755,7 @@ g_thread_ref (GThread *thread)
 
 /**
  * g_thread_unref:
- * @thread: a #GThread
+ * @thread: (transfer full): a #GThread
  *
  * Decrease the reference count on @thread, possibly freeing all
  * resources associated with it.
@@ -818,8 +818,8 @@ g_thread_n_created (void)
 /**
  * g_thread_new:
  * @name: (nullable): an (optional) name for the new thread
- * @func: a function to execute in the new thread
- * @data: an argument to supply to the new thread
+ * @func: (closure data) (scope async): a function to execute in the new thread
+ * @data: (nullable): an argument to supply to the new thread
  *
  * This function creates a new thread. The new thread starts by invoking
  * @func with the argument data. The thread will run until @func returns
@@ -849,7 +849,7 @@ g_thread_n_created (void)
  * Starting with GLib 2.64 the behaviour is now consistent between Windows and
  * POSIX and all threads inherit their parent thread's priority.
  *
- * Returns: the new #GThread
+ * Returns: (transfer full): the new #GThread
  *
  * Since: 2.32
  */
@@ -872,8 +872,8 @@ g_thread_new (const gchar *name,
 /**
  * g_thread_try_new:
  * @name: (nullable): an (optional) name for the new thread
- * @func: a function to execute in the new thread
- * @data: an argument to supply to the new thread
+ * @func: (closure data) (scope async): a function to execute in the new thread
+ * @data: (nullable): an argument to supply to the new thread
  * @error: return location for error, or %NULL
  *
  * This function is the same as g_thread_new() except that
@@ -882,7 +882,7 @@ g_thread_new (const gchar *name,
  * If a thread can not be created (due to resource limits),
  * @error is set and %NULL is returned.
  *
- * Returns: the new #GThread, or %NULL if an error occurred
+ * Returns: (transfer full): the new #GThread, or %NULL if an error occurred
  *
  * Since: 2.32
  */
@@ -953,7 +953,7 @@ g_thread_exit (gpointer retval)
 
 /**
  * g_thread_join:
- * @thread: a #GThread
+ * @thread: (transfer full): a #GThread
  *
  * Waits until @thread finishes, i.e. the function @func, as
  * given to g_thread_new(), returns or g_thread_exit() is called.
@@ -972,7 +972,7 @@ g_thread_exit (gpointer retval)
  * to be freed. Use g_thread_ref() to obtain an extra reference if you
  * want to keep the GThread alive beyond the g_thread_join() call.
  *
- * Returns: the return value of the thread
+ * Returns: (transfer full): the return value of the thread
  */
 gpointer
 g_thread_join (GThread *thread)
@@ -1008,7 +1008,7 @@ g_thread_join (GThread *thread)
  * (i.e. comparisons) but you must not use GLib functions (such
  * as g_thread_join()) on these threads.
  *
- * Returns: the #GThread representing the current thread
+ * Returns: (transfer none): the #GThread representing the current thread
  */
 GThread*
 g_thread_self (void)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]