Merge branch 'g-once-data-race' into 'master'

gthread: Remove unsynchronized access to g_once_init_list from assertion

See merge request GNOME/glib!477
This commit is contained in:
Philip Withnall 2018-11-19 19:11:41 +00:00
commit 11847b831e

View File

@ -691,10 +691,10 @@ void
g_return_if_fail (g_atomic_pointer_get (value_location) == NULL);
g_return_if_fail (result != 0);
g_return_if_fail (g_once_init_list != NULL);
g_atomic_pointer_set (value_location, result);
g_mutex_lock (&g_once_mutex);
g_return_if_fail (g_once_init_list != NULL);
g_once_init_list = g_slist_remove (g_once_init_list, (void*) value_location);
g_cond_broadcast (&g_once_cond);
g_mutex_unlock (&g_once_mutex);