Don't use deprecated GThread API in gio tests

This commit is contained in:
Matthias Clasen
2011-10-10 09:49:50 -04:00
parent 5662619f22
commit 93e49aea1b
19 changed files with 64 additions and 69 deletions

View File

@@ -602,10 +602,11 @@ test_peer (void)
/* bring up a server - we run the server in a different thread to avoid deadlocks */
error = NULL;
service_thread = g_thread_create (service_thread_func,
&data,
TRUE,
&error);
service_thread = g_thread_new ("test_peer",
service_thread_func,
&data,
TRUE,
&error);
while (service_loop == NULL)
g_thread_yield ();
g_assert (server != NULL);
@@ -1051,10 +1052,11 @@ delayed_message_processing (void)
data = g_new0 (DmpData, 1);
error = NULL;
service_thread = g_thread_create (dmp_thread_func,
data,
TRUE,
&error);
service_thread = g_thread_new ("dmp",
dmp_thread_func,
data,
TRUE,
&error);
while (data->server == NULL || !g_dbus_server_is_active (data->server))
g_thread_yield ();
@@ -1199,10 +1201,11 @@ test_nonce_tcp (void)
error = NULL;
server = NULL;
service_loop = NULL;
service_thread = g_thread_create (nonce_tcp_service_thread_func,
&data,
TRUE,
&error);
service_thread = g_thread_new ("nonce-tcp-service",
nonce_tcp_service_thread_func,
&data,
TRUE,
&error);
while (service_loop == NULL)
g_thread_yield ();
g_assert (server != NULL);
@@ -1508,10 +1511,11 @@ test_tcp_anonymous (void)
seen_connection = FALSE;
service_loop = NULL;
service_thread = g_thread_create (tcp_anonymous_service_thread_func,
&seen_connection, /* user_data */
TRUE, /* joinable */
&error);
service_thread = g_thread_new ("tcp-anon-service",
tcp_anonymous_service_thread_func,
&seen_connection, /* user_data */
TRUE, /* joinable */
&error);
while (service_loop == NULL)
g_thread_yield ();
g_assert (server != NULL);
@@ -1549,7 +1553,6 @@ main (int argc,
gchar *tmpdir = NULL;
g_type_init ();
g_thread_init (NULL);
g_test_init (&argc, &argv, NULL);
g_unsetenv ("DBUS_SESSION_BUS_ADDRESS");