thread: nuke the concept of 'joinable'

And remove the 'joinable' argument from g_thread_new() and
g_thread_new_full().

Change the wording in the docs.  Clarify expectations for
(deprecated) g_thread_create().
This commit is contained in:
Ryan Lortie
2011-10-13 00:43:33 -04:00
parent b0e73ca390
commit 015f4b4513
27 changed files with 88 additions and 93 deletions

View File

@@ -305,7 +305,6 @@ _g_dbus_shared_thread_ref (void)
data->thread = g_thread_new ("gdbus",
gdbus_shared_thread_func,
data,
TRUE,
&error);
g_assert_no_error (error);
/* We can cast between gsize and gpointer safely */

View File

@@ -75,7 +75,7 @@ idle_start_test1_thread (gpointer loop)
gboolean io_completed;
g_mutex_lock (&test1_mutex);
thread = g_thread_new ("test1", test1_thread, NULL, TRUE, NULL);
thread = g_thread_new ("test1", test1_thread, NULL, NULL);
g_get_current_time (&time);
time.tv_sec += 2;

View File

@@ -943,7 +943,6 @@ test_dispatch (const gchar *object_path)
thread = g_thread_new ("test_dispatch",
test_dispatch_thread_func,
(gpointer) object_path,
TRUE,
&error);
g_assert_no_error (error);
g_assert (thread != NULL);

View File

@@ -605,7 +605,6 @@ test_peer (void)
service_thread = g_thread_new ("test_peer",
service_thread_func,
&data,
TRUE,
&error);
while (service_loop == NULL)
g_thread_yield ();
@@ -1055,7 +1054,6 @@ delayed_message_processing (void)
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 ();
@@ -1204,7 +1202,6 @@ test_nonce_tcp (void)
service_thread = g_thread_new ("nonce-tcp-service",
nonce_tcp_service_thread_func,
&data,
TRUE,
&error);
while (service_loop == NULL)
g_thread_yield ();
@@ -1514,7 +1511,6 @@ test_tcp_anonymous (void)
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 ();

View File

@@ -222,7 +222,7 @@ test_proxy (void)
for (i = 0; i < n_threads; i++)
{
proxy_threads[i] = g_thread_new ("run-proxy",
run_proxy_thread, connection, TRUE,
run_proxy_thread, connection,
&error);
g_assert_no_error (error);
}

View File

@@ -568,7 +568,6 @@ on_name_acquired (GDBusConnection *connection,
g_thread_new ("check-proxies",
check_proxies_in_thread,
loop,
TRUE,
NULL);
}

View File

@@ -236,7 +236,6 @@ test_delivery_in_thread (void)
thread = g_thread_new ("deliver",
test_delivery_in_thread_func,
NULL,
TRUE,
&error);
g_assert_no_error (error);
g_assert (thread != NULL);
@@ -398,7 +397,6 @@ test_method_calls_on_proxy (GDBusProxy *proxy)
thread1 = g_thread_new ("sleep",
test_sleep_in_thread_func,
&data1,
TRUE,
&error);
g_assert_no_error (error);
g_assert (thread1 != NULL);
@@ -411,7 +409,6 @@ test_method_calls_on_proxy (GDBusProxy *proxy)
thread2 = g_thread_new ("sleep2",
test_sleep_in_thread_func,
&data2,
TRUE,
&error);
g_assert_no_error (error);
g_assert (thread2 != NULL);
@@ -424,7 +421,6 @@ test_method_calls_on_proxy (GDBusProxy *proxy)
thread3 = g_thread_new ("sleep3",
test_sleep_in_thread_func,
&data3,
TRUE,
&error);
g_assert_no_error (error);
g_assert (thread3 != NULL);

View File

@@ -201,7 +201,13 @@ start_sync_lookups (char **argv, int argc)
int i;
for (i = 0; i < argc; i++)
g_thread_new ("lookup", lookup_thread, argv[i], FALSE, NULL);
{
GThread *thread;
thread = g_thread_new ("lookup", lookup_thread, argv[i], NULL);
g_assert (thread != NULL);
g_thread_unref (thread);
}
}
static void

View File

@@ -90,8 +90,12 @@ main (int argc, char *argv[])
if (cancel_timeout)
{
GThread *thread;
cancellable = g_cancellable_new ();
g_thread_new ("cancel", cancel_thread, cancellable, FALSE, NULL);
thread = g_thread_new ("cancel", cancel_thread, cancellable, NULL);
g_assert (thread != NULL);
g_thread_unref (thread);
}
else
{

View File

@@ -288,8 +288,12 @@ main (int argc,
if (cancel_timeout)
{
GThread *thread;
cancellable = g_cancellable_new ();
g_thread_new ("cancel", cancel_thread, cancellable, FALSE, NULL);
thread = g_thread_new ("cancel", cancel_thread, cancellable, NULL);
g_assert (thread != NULL);
g_thread_unref (thread);
}
else
{

View File

@@ -81,8 +81,12 @@ main (int argc,
if (cancel_timeout)
{
GThread *thread;
cancellable = g_cancellable_new ();
g_thread_new ("cancel", cancel_thread, cancellable, FALSE, NULL);
thread = g_thread_new ("cancel", cancel_thread, cancellable, NULL);
g_assert (thread != NULL);
g_thread_unref (thread);
}
else
{

View File

@@ -128,7 +128,7 @@ create_server (GSocketFamily family,
g_socket_listen (server, &error);
g_assert_no_error (error);
data->thread = g_thread_new ("server", server_thread, data, TRUE, &error);
data->thread = g_thread_new ("server", server_thread, data, &error);
g_assert_no_error (error);
return data;

View File

@@ -437,7 +437,7 @@ setup_with_thread_loop (Test *test,
closure.test = test;
g_mutex_lock (&closure.loop_mutex);
test->loop_thread = g_thread_new ("loop", thread_loop, &closure, TRUE, &error);
test->loop_thread = g_thread_new ("loop", thread_loop, &closure, &error);
while (!closure.started)
g_cond_wait (&closure.loop_started, &closure.loop_mutex);
g_mutex_unlock (&closure.loop_mutex);

View File

@@ -216,8 +216,8 @@ test_pipe_io (void)
reader_cancel = g_cancellable_new ();
main_cancel = g_cancellable_new ();
writer = g_thread_new ("writer", writer_thread, NULL, TRUE, NULL);
reader = g_thread_new ("reader", reader_thread, NULL, TRUE, NULL);
writer = g_thread_new ("writer", writer_thread, NULL, NULL);
reader = g_thread_new ("reader", reader_thread, NULL, NULL);
in = g_unix_input_stream_new (writer_pipe[0], TRUE);
out = g_unix_output_stream_new (reader_pipe[1], TRUE);