Add atomically refcounted data

Desktop / GNOME / GLib - Emmanuele Bassi [gnome.org] - 9 July 2018 09:11 EDT

GArcBox is the atomic reference counting version of GRcBox. Unlike GRcBox, the reference acquisition and release on GArcBox are guaranteed to be atomic, and thus they can be performed from different threads.

This is similar to Rust's Arc> combination of traits.

b607927a4 Add atomically refcounted data
docs/reference/glib/glib-docs.xml | 1 +
docs/reference/glib/glib-sections.txt | 12 ++
glib/Makefile.am | 2 +
glib/garcbox.c | 333 ++++++++++++++++++++++++++++++++++
glib/grcbox.c | 59 +++---
glib/grcbox.h | 29 ++-
glib/grcboxprivate.h | 42 +++++
glib/meson.build | 1 +
8 files changed, 447 insertions(+), 32 deletions(-)

Upstream: git.gnome.org


  • Share