mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-14 00:06:24 +01:00
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:
parent
ea746c79fa
commit
3dda662beb
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
|
@ -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++)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user