diff options
author | Colin Walters <walters@verbum.org> | 2012-11-19 21:42:44 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2013-04-02 12:10:33 -0400 |
commit | 4b1bf70c93acb3446c1e9049ac422d911a10762d (patch) | |
tree | 8e907416cbc06a272e9e999a8b05e87e6a2fefab /girepository/girepository-private.h | |
parent | 49b80bb567115b95c1051d2f01da7679e4e08154 (diff) | |
download | gobject-introspection-4b1bf70c93acb3446c1e9049ac422d911a10762d.tar.gz |
girepository: Use g_atomic for refcounting
They could be freed in separate threads (e.g. language binding GC
thread). But no particular reason to change other than noticing it
during code inspection for a different bug.
https://bugzilla.gnome.org/show_bug.cgi?id=688694
Diffstat (limited to 'girepository/girepository-private.h')
-rw-r--r-- | girepository/girepository-private.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/girepository/girepository-private.h b/girepository/girepository-private.h index 275776d8..bbd34e3e 100644 --- a/girepository/girepository-private.h +++ b/girepository/girepository-private.h @@ -33,6 +33,11 @@ typedef struct _GIRealInfo GIRealInfo; +/* We changed a gint32 -> gint in the structure below, which should be + * valid everywhere we care about. + */ +G_STATIC_ASSERT (sizeof (int) == sizeof (gint32)); + /* * We just use one structure for all of the info object * types; in general, we should be reading data directly @@ -43,7 +48,7 @@ struct _GIRealInfo { /* Keep this part in sync with GIUnresolvedInfo below */ gint32 type; - gint32 ref_count; + volatile gint ref_count; GIRepository *repository; GIBaseInfo *container; @@ -62,7 +67,7 @@ struct _GIUnresolvedInfo { /* Keep this part in sync with GIBaseInfo above */ gint32 type; - gint32 ref_count; + volatile gint ref_count; GIRepository *repository; GIBaseInfo *container; |