mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-05 10:38:08 +01:00
arcbox: Document that implementing weak references via the clear_func is not safe
This commit is contained in:
parent
de7779fbd3
commit
546b15312f
@ -207,6 +207,11 @@ g_atomic_rc_box_release (gpointer mem_block)
|
|||||||
* to clear the contents of @mem_block, and then will free the
|
* to clear the contents of @mem_block, and then will free the
|
||||||
* resources allocated for @mem_block.
|
* resources allocated for @mem_block.
|
||||||
*
|
*
|
||||||
|
* Note that implementing weak references via @clear_func is not thread-safe:
|
||||||
|
* clearing a pointer to the memory from the callback can race with another
|
||||||
|
* thread trying to access it as @mem_block already has a reference count of 0
|
||||||
|
* when the callback is called and will be freed.
|
||||||
|
*
|
||||||
* Since: 2.58
|
* Since: 2.58
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
|
Loading…
x
Reference in New Issue
Block a user