mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-27 16:06:16 +01:00
gvarianttypeinfo: Consistently use atomics to access ref_count
This commit is contained in:
parent
d3f5559780
commit
03518e576e
@ -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