glib: Drop unnecessary volatile qualifiers from internal variables

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:40:56 +00:00
parent 9474655eb2
commit 1314ff93fc
6 changed files with 13 additions and 13 deletions

View File

@@ -513,7 +513,7 @@ static GMutex g_once_mutex;
static GCond g_once_cond;
static GSList *g_once_init_list = NULL;
static volatile guint g_thread_n_created_counter = 0;
static guint g_thread_n_created_counter = 0; /* (atomic) */
static void g_thread_cleanup (gpointer data);
static GPrivate g_thread_specific_private = G_PRIVATE_INIT (g_thread_cleanup);
@@ -694,7 +694,7 @@ g_once_impl (GOnce *once,
gboolean
(g_once_init_enter) (volatile void *location)
{
volatile gsize *value_location = location;
gsize *value_location = (gsize *) location;
gboolean need_init = FALSE;
g_mutex_lock (&g_once_mutex);
if (g_atomic_pointer_get (value_location) == 0)
@@ -731,7 +731,7 @@ void
(g_once_init_leave) (volatile void *location,
gsize result)
{
volatile gsize *value_location = location;
gsize *value_location = (gsize *) location;
g_return_if_fail (g_atomic_pointer_get (value_location) == 0);
g_return_if_fail (result != 0);