tests: Drop unnecessary volatile qualifiers from tests

These variables were already (correctly) accessed atomically. The
`volatile` qualifier doesn’t help with that.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #600
This commit is contained in:
Philip Withnall 2020-11-11 18:16:17 +00:00
parent ea746c79fa
commit 3dda662beb
5 changed files with 6 additions and 6 deletions

View File

@ -248,8 +248,8 @@ G_GNUC_END_IGNORE_DEPRECATIONS
#define THREADS 10
#define ROUNDS 10000
volatile gint bucket[THREADS];
volatile gint atomic;
gint bucket[THREADS]; /* never contested by threads, not accessed atomically */
gint atomic; /* (atomic) */
static gpointer
thread_func (gpointer data)

View File

@ -29,7 +29,7 @@
static GCond cond;
static GMutex mutex;
static volatile gint next;
static gint next; /* locked by @mutex */
static void
push_value (gint value)

View File

@ -92,7 +92,7 @@ struct context
static struct context contexts[NUM_THREADS];
static GThread *threads[NUM_THREADS];
static GWakeup *last_token_wakeup;
static volatile gint tokens_alive;
static gint tokens_alive; /* (atomic) */
static void
context_init (struct context *ctx)

View File

@ -1362,7 +1362,7 @@ struct _GHashTable
GHashFunc hash_func;
GEqualFunc key_equal_func;
volatile gint ref_count;
gint ref_count; /* (atomic) */
#ifndef G_DISABLE_ASSERT
int version;

View File

@ -107,7 +107,7 @@ thread_allocate (gpointer data)
gint b;
gint size;
gpointer p;
volatile gpointer *loc;
gpointer *loc; /* (atomic) */
for (i = 0; i < 10000; i++)
{