[glib: 1/2] gthread: Synchronize access to g_once_init_list
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [glib: 1/2] gthread: Synchronize access to g_once_init_list
- Date: Mon, 19 Nov 2018 19:11:59 +0000 (UTC)
commit c2b22bd61550bb03db223dd9bab9b8abb6fed277
Author: Tomasz Miąsko <tomasz miasko gmail com>
Date:   Fri Nov 2 00:00:00 2018 +0000
    gthread: Synchronize access to g_once_init_list
 glib/gthread.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/glib/gthread.c b/glib/gthread.c
index 5debfa6ae..a2f3351b2 100644
--- a/glib/gthread.c
+++ b/glib/gthread.c
@@ -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);
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]