gcc-11 compat, volatile atomic variables (1/2)

"While 'atomic' has a volatile qualifier, this is a historical
artifact and the pointer passed to it should not be volatile."

Furthermore "It is very important that all accesses to a
particular integer or pointer be performed using only this API"
(from https://developer.gnome.org/glib/2.68/glib-Atomic-Operations.html)

Hence initialization of atomic variables is changed to also use
this API, instead of directly initializing the value.

This also fixes a few cases where atomic variables were
accessed directly.

see also libs/pbd/pbd/g_atomic_compat.h
This commit is contained in:
Robin Gareus 2021-03-19 06:12:11 +01:00
parent bf64852fc2
commit cc7b8b1bc5
No known key found for this signature in database
GPG key ID: A090BCE02CF57F04
61 changed files with 368 additions and 272 deletions

View file

@ -254,9 +254,9 @@ WaveViewCache::set_image_cache_threshold (uint64_t sz)
/*-------------------------------------------------*/
WaveViewDrawRequest::WaveViewDrawRequest () : stop (0)
WaveViewDrawRequest::WaveViewDrawRequest ()
{
g_atomic_int_set (&_stop, 0);
}
WaveViewDrawRequest::~WaveViewDrawRequest ()
@ -407,8 +407,8 @@ WaveViewThreads::stop_threads ()
WaveViewDrawingThread::WaveViewDrawingThread ()
: _thread(0)
, _quit(0)
{
g_atomic_int_set (&_quit, 0);
start ();
}