gthread: Synchronize access to g_once_init_list

This commit is contained in:
Tomasz Miąsko 2018-11-02 00:00:00 +00:00
parent 8a96fca390
commit c2b22bd615

View File

@ -691,10 +691,10 @@ void
g_return_if_fail (g_atomic_pointer_get (value_location) == NULL); g_return_if_fail (g_atomic_pointer_get (value_location) == NULL);
g_return_if_fail (result != 0); g_return_if_fail (result != 0);
g_return_if_fail (g_once_init_list != NULL);
g_atomic_pointer_set (value_location, result); g_atomic_pointer_set (value_location, result);
g_mutex_lock (&g_once_mutex); 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_once_init_list = g_slist_remove (g_once_init_list, (void*) value_location);
g_cond_broadcast (&g_once_cond); g_cond_broadcast (&g_once_cond);
g_mutex_unlock (&g_once_mutex); g_mutex_unlock (&g_once_mutex);