mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-10-28 06:52:18 +01:00
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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user