diff options
author | Matthew Waters <matthew@centricular.com> | 2021-03-18 19:52:53 +1100 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2021-04-13 01:54:33 +0100 |
commit | a1bf3d8d540a25268d612a489e1e836d6ea737b0 (patch) | |
tree | 9b30446ecf6c4f2466082c6649009fba6982f1d4 /ext/qt/qtglrenderer.cc | |
parent | d2b82cd8c476615b176da56c137543d84c7c7fad (diff) | |
download | gstreamer-plugins-good-a1bf3d8d540a25268d612a489e1e836d6ea737b0.tar.gz |
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-plugins-good/-/merge_requests/941>
Diffstat (limited to 'ext/qt/qtglrenderer.cc')
-rw-r--r-- | ext/qt/qtglrenderer.cc | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/qt/qtglrenderer.cc b/ext/qt/qtglrenderer.cc index 2ad5601fc..52965fd0b 100644 --- a/ext/qt/qtglrenderer.cc +++ b/ext/qt/qtglrenderer.cc @@ -22,7 +22,7 @@ GST_DEBUG_CATEGORY_STATIC (GST_CAT_DEFAULT); static void init_debug (void) { - static volatile gsize _debug; + static gsize _debug; if (g_once_init_enter (&_debug)) { GST_DEBUG_CATEGORY_INIT (GST_CAT_DEFAULT, "qtglrenderer", 0, @@ -115,7 +115,7 @@ typedef enum struct SharedRenderData { - volatile int refcount; + int refcount; SharedRenderDataState state; GMutex lock; GCond cond; @@ -130,7 +130,7 @@ shared_render_data_new (void) { struct SharedRenderData *ret = g_new0 (struct SharedRenderData, 1); - ret->refcount = 1; + g_atomic_int_set (&ret->refcount, 1); g_mutex_init (&ret->lock); return ret; |