diff options
author | Philip Withnall <pwithnall@endlessos.org> | 2020-11-11 18:16:17 +0000 |
---|---|---|
committer | Philip Withnall <pwithnall@endlessos.org> | 2020-11-20 14:40:19 +0000 |
commit | 3dda662bebb81666d009635df1055ba5c1e17b52 (patch) | |
tree | 3753f4f75605719df682f1ea9d90e2f35f925524 | |
parent | ea746c79faf554d980c21b0e4381753e003d2dc6 (diff) | |
download | glib-3dda662bebb81666d009635df1055ba5c1e17b52.tar.gz |
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
-rw-r--r-- | glib/tests/atomic.c | 4 | ||||
-rw-r--r-- | glib/tests/cond.c | 2 | ||||
-rw-r--r-- | glib/tests/gwakeuptest.c | 2 | ||||
-rw-r--r-- | glib/tests/hash.c | 2 | ||||
-rw-r--r-- | glib/tests/slice.c | 2 |
5 files changed, 6 insertions, 6 deletions
diff --git a/glib/tests/atomic.c b/glib/tests/atomic.c index 6b6cc7f3e..7d2459f3a 100644 --- a/glib/tests/atomic.c +++ b/glib/tests/atomic.c @@ -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) diff --git a/glib/tests/cond.c b/glib/tests/cond.c index 0f0b3d249..ed338cce3 100644 --- a/glib/tests/cond.c +++ b/glib/tests/cond.c @@ -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) diff --git a/glib/tests/gwakeuptest.c b/glib/tests/gwakeuptest.c index 461a7d3de..b37fb43fc 100644 --- a/glib/tests/gwakeuptest.c +++ b/glib/tests/gwakeuptest.c @@ -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) diff --git a/glib/tests/hash.c b/glib/tests/hash.c index 4623d18d1..f4ff55ce1 100644 --- a/glib/tests/hash.c +++ b/glib/tests/hash.c @@ -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; diff --git a/glib/tests/slice.c b/glib/tests/slice.c index f37826f3a..a566280db 100644 --- a/glib/tests/slice.c +++ b/glib/tests/slice.c @@ -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++) { |