Commit 2586eb99 authored by Philip Withnall's avatar Philip Withnall

docs: Clarify lack of threading guarantees in GArray

Signed-off-by: Philip Withnall's avatarPhilip Withnall <withnall@endlessm.com>

https://bugzilla.gnome.org/show_bug.cgi?id=786555
parent 8cac6797
......@@ -244,7 +244,7 @@ g_array_set_clear_func (GArray *array,
* @array: A #GArray
*
* Atomically increments the reference count of @array by one.
* This function is MT-safe and may be called from any thread.
* This function is thread-safe and may be called from any thread.
*
* Returns: The passed in #GArray
*
......@@ -275,7 +275,7 @@ static gchar *array_free (GRealArray *, ArrayFreeFlags);
*
* Atomically decrements the reference count of @array by one. If the
* reference count drops to 0, all memory allocated by the array is
* released. This function is MT-safe and may be called from any
* released. This function is thread-safe and may be called from any
* thread.
*
* Since: 2.22
......@@ -326,6 +326,10 @@ g_array_get_element_size (GArray *array)
* If array elements contain dynamically-allocated memory, they should
* be freed separately.
*
* This function is not thread-safe. If using a #GArray from multiple
* threads, use only the atomic g_array_ref() and g_array_unref()
* functions.
*
* Returns: the element data if @free_segment is %FALSE, otherwise
* %NULL. The element data should be freed using g_free().
*/
......@@ -1031,7 +1035,7 @@ static gpointer *ptr_array_free (GPtrArray *, ArrayFreeFlags);
* Atomically decrements the reference count of @array by one. If the
* reference count drops to 0, the effect is the same as calling
* g_ptr_array_free() with @free_segment set to %TRUE. This function
* is MT-safe and may be called from any thread.
* is thread-safe and may be called from any thread.
*
* Since: 2.22
*/
......@@ -1062,6 +1066,10 @@ g_ptr_array_unref (GPtrArray *array)
* be freed separately if @free_seg is %TRUE and no #GDestroyNotify
* function has been set for @array.
*
* This function is not thread-safe. If using a #GPtrArray from multiple
* threads, use only the atomic g_ptr_array_ref() and g_ptr_array_unref()
* functions.
*
* Returns: the pointer array if @free_seg is %FALSE, otherwise %NULL.
* The pointer array should be freed using g_free().
*/
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment