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.
In case of orc, the volatile integers were always protected with a
mutex, which makes it completely unnecessary.
Part-of: <https://gitlab.freedesktop.org/gstreamer/orc/-/merge_requests/91>
void
orc_init (void)
{
- static volatile int inited = FALSE;
+ static int inited = FALSE;
if (!inited) {
orc_global_mutex_lock ();
orc_memcpy (void * ORC_RESTRICT d1, const void * ORC_RESTRICT s1, int n)
{
OrcExecutor _ex, *ex = &_ex;
- static volatile int p_inited = 0;
+ static int p_inited = 0;
static OrcCode *c = 0;
void (*func) (OrcExecutor *);
orc_memset (void * ORC_RESTRICT d1, int p1, int n)
{
OrcExecutor _ex, *ex = &_ex;
- static volatile int p_inited = 0;
+ static int p_inited = 0;
static OrcCode *c = 0;
void (*func) (OrcExecutor *);
fprintf(output, " OrcProgram *p = _orc_program_%s;\n", p->name);
}
} else {
- fprintf(output, " static volatile int p_inited = 0;\n");
+ fprintf(output, " static int p_inited = 0;\n");
if (use_code) {
fprintf(output, " static OrcCode *c = 0;\n");
} else {