volatile is not sufficient to provide atomic guarantees and real atomics
should be used instead. GCC 11 has started warning about using volatile
with atomic operations.
https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719
Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868
Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-editing-services/-/merge_requests/234>
typedef struct _PadInfos
{
- volatile gint refcount;
+ gint refcount;
GESSmartMixer *self;
GstPad *mixer_pad;
pad_infos_new (void)
{
PadInfos *info = g_new0 (PadInfos, 1);
- info->refcount = 1;
+ g_atomic_int_set (&info->refcount, 1);
return info;
}
GType
gst_frame_positioner_meta_api_get_type (void)
{
- static volatile GType type;
+ static GType type;
static const gchar *tags[] = { "video", NULL };
if (g_once_init_enter (&type)) {
gint seqnum_to_restart_task;
gboolean waiting_serialized_query_or_buffer;
GstEvent *stack_initialization_seek;
- volatile gboolean stack_initialization_seek_sent;
+ gboolean stack_initialization_seek_sent;
gboolean tearing_down_stack;
gboolean suppress_child_error;
GType
nle_object_get_type (void)
{
- static volatile gsize type = 0;
+ static gsize type = 0;
if (g_once_init_enter (&type)) {
GType _type;