mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-10 19:36:18 +01:00
Merge branch 'atomic-ref-count' into 'master'
gvarianttypeinfo: Consistently use atomics to access ref_count See merge request GNOME/glib!444
This commit is contained in:
commit
8f115b63b1
@ -167,7 +167,7 @@ g_variant_type_info_check (const GVariantTypeInfo *info,
|
||||
ContainerInfo *container = (ContainerInfo *) info;
|
||||
|
||||
/* extra checks for containers */
|
||||
g_assert_cmpint (container->ref_count, >, 0);
|
||||
g_assert_cmpint (g_atomic_int_get (&container->ref_count), >, 0);
|
||||
g_assert (container->type_string != NULL);
|
||||
}
|
||||
else
|
||||
@ -834,7 +834,7 @@ g_variant_type_info_ref (GVariantTypeInfo *info)
|
||||
{
|
||||
ContainerInfo *container = (ContainerInfo *) info;
|
||||
|
||||
g_assert_cmpint (container->ref_count, >, 0);
|
||||
g_assert_cmpint (g_atomic_int_get (&container->ref_count), >, 0);
|
||||
g_atomic_int_inc (&container->ref_count);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user