gvarianttypeinfo: Consistently use atomics to access ref_count

This commit is contained in:
Tomasz Miąsko 2018-11-01 00:00:00 +00:00
parent d3f5559780
commit 03518e576e

View File

@ -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);
}