Initialize service_loop before running the service thread
authorChris Coulson <chris.coulson@canonical.com>
Wed, 14 Dec 2011 14:00:56 +0000 (14:00 +0000)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 15 Dec 2011 02:15:35 +0000 (21:15 -0500)
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=666129

gio/tests/gdbus-peer.c

index 7eeb59d..9ee0b08 100644 (file)
@@ -1678,10 +1678,10 @@ codegen_test_peer (void)
   GVariant            *value;
 
   /* bring up a server - we run the server in a different thread to avoid deadlocks */
+  service_loop = NULL;
   service_thread = g_thread_new ("codegen_test_peer",
                                  codegen_service_thread_func,
                                  NULL);
-  service_loop = NULL;
   while (service_loop == NULL)
     g_thread_yield ();
   g_assert (codegen_server != NULL);