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 19:22:49 +00:00
parent 334f695336
commit 8a112c3c6e
2 changed files with 3 additions and 3 deletions

View File

@ -17,7 +17,7 @@ gboolean fail;
#define ROUNDS 10000
GObject *object;
volatile gint bucket[THREADS];
gint bucket[THREADS]; /* accessed from multiple threads, but should never be contested due to the sequence of thread operations */
static gpointer
thread_func (gpointer data)

View File

@ -27,8 +27,8 @@
#include <glib.h>
#include <glib-object.h>
static volatile int mtsafe_call_counter = 0; /* multi thread safe call counter */
static int unsafe_call_counter = 0; /* single-threaded call counter */
static int mtsafe_call_counter = 0; /* multi thread safe call counter, must be accessed atomically */
static int unsafe_call_counter = 0; /* single-threaded call counter */
static GCond sync_cond;
static GMutex sync_mutex;