SetupData *data;
g_type_init ();
- g_thread_init (NULL);
g_test_init (&argc, &argv, NULL);
gboolean io_completed;
g_mutex_lock (&test1_mutex);
- thread = g_thread_create (test1_thread, NULL, TRUE, NULL);
+ thread = g_thread_new ("test1", test1_thread, NULL, TRUE, NULL);
g_get_current_time (&time);
time.tv_sec += 2;
{
GError *error = NULL;
- g_thread_init (NULL);
g_type_init ();
g_test_init (&argc, &argv, NULL);
GError *error = NULL;
g_type_init ();
- g_thread_init (NULL);
context = g_option_context_new (" - Test GSocket server stuff");
g_option_context_add_main_entries (context, cmd_entries, NULL);
gint ret;
g_type_init ();
- g_thread_init (NULL);
g_test_init (&argc, &argv, NULL);
/* all the tests rely on a shared main loop */
/* run this in a thread to avoid deadlocks */
error = NULL;
- thread = g_thread_create (test_dispatch_thread_func,
- (gpointer) object_path,
- TRUE,
- &error);
+ thread = g_thread_new ("test_dispatch",
+ test_dispatch_thread_func,
+ (gpointer) object_path,
+ TRUE,
+ &error);
g_assert_no_error (error);
g_assert (thread != NULL);
g_main_loop_run (loop);
gint ret;
g_type_init ();
- g_thread_init (NULL);
g_test_init (&argc, &argv, NULL);
/* all the tests rely on a shared main loop */
/* 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);
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 ();
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);
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);
gchar *tmpdir = NULL;
g_type_init ();
- g_thread_init (NULL);
g_test_init (&argc, &argv, NULL);
g_unsetenv ("DBUS_SESSION_BUS_ADDRESS");
for (i = 0; i < n_threads; i++)
{
- proxy_threads[i] = g_thread_create (run_proxy_thread, connection, TRUE,
- &error);
+ proxy_threads[i] = g_thread_new ("run-proxy",
+ run_proxy_thread, connection, TRUE,
+ &error);
g_assert_no_error (error);
}
{
GMainLoop *loop = user_data;
- g_thread_create (check_proxies_in_thread,
- loop,
- TRUE,
- NULL);
+ g_thread_new ("check-proxies",
+ check_proxies_in_thread,
+ loop,
+ TRUE,
+ NULL);
}
static void
GThread *thread;
error = NULL;
- thread = g_thread_create (test_delivery_in_thread_func,
- NULL,
- TRUE,
- &error);
+ thread = g_thread_new ("deliver",
+ test_delivery_in_thread_func,
+ NULL,
+ TRUE,
+ &error);
g_assert_no_error (error);
g_assert (thread != NULL);
data1.num = 100;
data1.async = do_async;
data1.done = FALSE;
- thread1 = g_thread_create (test_sleep_in_thread_func,
- &data1,
- TRUE,
- &error);
+ thread1 = g_thread_new ("sleep",
+ test_sleep_in_thread_func,
+ &data1,
+ TRUE,
+ &error);
g_assert_no_error (error);
g_assert (thread1 != NULL);
data2.num = 200;
data2.async = do_async;
data2.done = FALSE;
- thread2 = g_thread_create (test_sleep_in_thread_func,
- &data2,
- TRUE,
- &error);
+ thread2 = g_thread_new ("sleep2",
+ test_sleep_in_thread_func,
+ &data2,
+ TRUE,
+ &error);
g_assert_no_error (error);
g_assert (thread2 != NULL);
data3.num = 40;
data3.async = do_async;
data3.done = FALSE;
- thread3 = g_thread_create (test_sleep_in_thread_func,
- &data3,
- TRUE,
- &error);
+ thread3 = g_thread_new ("sleep3",
+ test_sleep_in_thread_func,
+ &data3,
+ TRUE,
+ &error);
g_assert_no_error (error);
g_assert (thread3 != NULL);
gint ret;
g_type_init ();
- g_thread_init (NULL);
g_test_init (&argc, &argv, NULL);
/* all the tests rely on a shared main loop */
GError *error = NULL;
g_type_init ();
- g_thread_init (NULL);
context = g_option_context_new ("<http root dir> - Simple HTTP server");
g_option_context_add_main_entries (context, cmd_entries, NULL);
int i;
for (i = 0; i < argc; i++)
- g_thread_create (lookup_thread, argv[i], FALSE, NULL);
+ g_thread_new ("lookup", lookup_thread, argv[i], FALSE, NULL);
}
static void
char buffer[1000];
g_type_init ();
- g_thread_init (NULL);
context = g_option_context_new (" <hostname>[:port] - send data to tcp host");
g_option_context_add_main_entries (context, cmd_entries, NULL);
if (cancel_timeout)
{
cancellable = g_cancellable_new ();
- g_thread_create (cancel_thread, cancellable, FALSE, NULL);
+ g_thread_new ("cancel", cancel_thread, cancellable, FALSE, NULL);
}
else
{
GTlsCertificate *certificate = NULL;
gint i;
- g_thread_init (NULL);
-
g_type_init ();
address = NULL;
if (cancel_timeout)
{
cancellable = g_cancellable_new ();
- g_thread_create (cancel_thread, cancellable, FALSE, NULL);
+ g_thread_new ("cancel", cancel_thread, cancellable, FALSE, NULL);
}
else
{
GInputStream *istream;
GOutputStream *ostream;
- g_thread_init (NULL);
-
g_type_init ();
context = g_option_context_new (" - Test GSocket server stuff");
if (cancel_timeout)
{
cancellable = g_cancellable_new ();
- g_thread_create (cancel_thread, cancellable, FALSE, NULL);
+ g_thread_new ("cancel", cancel_thread, cancellable, FALSE, NULL);
}
else
{
g_socket_listen (server, &error);
g_assert_no_error (error);
- data->thread = g_thread_create (server_thread, data, TRUE, &error);
+ data->thread = g_thread_new ("server", server_thread, data, TRUE, &error);
g_assert_no_error (error);
return data;
closure.test = test;
g_mutex_lock (&closure.loop_mutex);
- test->loop_thread = g_thread_create (thread_loop, &closure, TRUE, &error);
+ test->loop_thread = g_thread_new ("loop", thread_loop, &closure, TRUE, &error);
while (!closure.started)
g_cond_wait (&closure.loop_started, &closure.loop_mutex);
g_mutex_unlock (&closure.loop_mutex);
gint ret;
g_type_init ();
- g_thread_init (NULL);
g_test_init (&argc, &argv, NULL);
fixtures = g_ptr_array_new_with_free_func (g_free);
reader_cancel = g_cancellable_new ();
main_cancel = g_cancellable_new ();
- writer = g_thread_create (writer_thread, NULL, TRUE, NULL);
- reader = g_thread_create (reader_thread, NULL, TRUE, NULL);
+ writer = g_thread_new ("writer", writer_thread, NULL, TRUE, NULL);
+ reader = g_thread_new ("reader", reader_thread, NULL, TRUE, NULL);
in = g_unix_input_stream_new (writer_pipe[0], TRUE);
out = g_unix_output_stream_new (reader_pipe[1], TRUE);
main (int argc,
char *argv[])
{
- g_thread_init (NULL);
g_type_init ();
g_test_init (&argc, &argv, NULL);
reader_cancel = g_cancellable_new ();
main_cancel = g_cancellable_new ();
- writer = g_thread_create (writer_thread, NULL, TRUE, NULL);
- reader = g_thread_create (reader_thread, NULL, TRUE, NULL);
+ writer = g_thread_new ("writer", writer_thread, NULL, TRUE, NULL);
+ reader = g_thread_new ("reader", reader_thread, NULL, TRUE, NULL);
g_assert (DuplicateHandle (GetCurrentProcess (),
(HANDLE) (gintptr) _get_osfhandle (writer_pipe[0]),
main (int argc,
char *argv[])
{
- g_thread_init (NULL);
g_type_init ();
g_test_init (&argc, &argv, NULL);