gst: don't use volatile to mean atomic

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-docs/-/merge_requests/150>
This commit is contained in:
Matthew Waters 2021-03-19 17:31:51 +11:00
parent 3b2f3939a4
commit 10a461daf4
2 changed files with 2 additions and 2 deletions

View file

@ -274,7 +274,7 @@ Here is the code:
#include <gst/gst.h>
static GMainLoop *loop;
static volatile gint counter;
static gint counter;
static GstBus *bus;
static gboolean prerolled = FALSE;
static GstPad *sinkpad;

View file

@ -287,7 +287,7 @@ function is implemented in the `my-example-meta.c` file:
GType
my_example_meta_api_get_type (void)
{
static volatile GType type;
static GType type;
static const gchar *tags[] = { "foo", "bar", NULL };
if (g_once_init_enter (&type)) {