Drop use of volatile

As detailed in
gitlab.gnome.org/GNOME/glib/-/issues/600#note_877282, volatile
isn't actually needed in these contexts because the atomic operations
already give us strong enough guarantees. In GCC 11, this triggers a
diagnostic due to the volatile qualifier getting dropped anyway.

There is a WIP to do the same in glib:
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719

This obsoletes this downstream patch:
https://src.fedoraproject.org/rpms/ostree/c/b8c5a6fb
This commit is contained in:
Jonathan Lebon committed 2020-11-02 14:53:26 -05:00
1 parent 64e09f46b8
commit f895cf4fd2
6 files changed
+13 -13

No files matched your search

+4 -4
View File
@@ -36,9 +36,9 @@
GType
_@enum_name@_get_type (void)
{
static volatile gsize the_type__volatile = 0;
static gsize static_the_type = 0;
if (g_once_init_enter (&the_type__volatile))
if (g_once_init_enter (&static_the_type))
{
static const G@Type@Value values[] = {
/*** END value-header ***/
@@ -57,10 +57,10 @@ _@enum_name@_get_type (void)
g_intern_static_string ("@EnumName@"),
values);
g_once_init_leave (&the_type__volatile, the_type);
g_once_init_leave (&static_the_type, the_type);
}
return the_type__volatile;
return static_the_type;
}
/*** END value-tail ***/