mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-12 20:36:15 +01:00
gthread: Synchronize access to g_once_init_list
This commit is contained in:
parent
8a96fca390
commit
c2b22bd615
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user