From 015f4b4513279c4be40c03121473ffcea347ed84 Mon Sep 17 00:00:00 2001 From: Ryan Lortie Date: Thu, 13 Oct 2011 00:43:33 -0400 Subject: [PATCH] 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(). --- gio/gdbusprivate.c | 1 - gio/tests/contexts.c | 2 +- gio/tests/gdbus-export.c | 1 - gio/tests/gdbus-peer.c | 4 --- gio/tests/gdbus-proxy-threads.c | 2 +- gio/tests/gdbus-test-codegen.c | 1 - gio/tests/gdbus-threading.c | 4 --- gio/tests/resolver.c | 8 +++++- gio/tests/send-data.c | 6 ++++- gio/tests/socket-client.c | 6 ++++- gio/tests/socket-server.c | 6 ++++- gio/tests/socket.c | 2 +- gio/tests/tls-interaction.c | 2 +- gio/tests/unix-streams.c | 4 +-- glib/deprecated/gthread-deprecated.c | 24 ++++++++++++------ glib/gmain.c | 2 +- glib/gthread.c | 48 +++++++++++------------------------- glib/gthread.h | 2 -- glib/gthreadpool.c | 13 +++++----- glib/gthreadprivate.h | 14 +++++------ glib/tests/once.c | 2 +- glib/tests/thread.c | 12 ++++----- gobject/tests/dynamictests.c | 2 +- gthread/tests/1bit-mutex.c | 4 +-- gthread/tests/atomic.c | 2 +- gthread/tests/gwakeuptest.c | 2 +- gthread/tests/spawn-multithreaded.c | 3 +-- 27 files changed, 87 insertions(+), 92 deletions(-) diff --git a/gio/gdbusprivate.c b/gio/gdbusprivate.c index 480f518..b5c770b 100644 --- a/gio/gdbusprivate.c +++ b/gio/gdbusprivate.c @@ -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 */ diff --git a/gio/tests/contexts.c b/gio/tests/contexts.c index 4d42dac..17bfe4a 100644 --- a/gio/tests/contexts.c +++ b/gio/tests/contexts.c @@ -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; diff --git a/gio/tests/gdbus-export.c b/gio/tests/gdbus-export.c index a302495..9ee1c3d 100644 --- a/gio/tests/gdbus-export.c +++ b/gio/tests/gdbus-export.c @@ -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); diff --git a/gio/tests/gdbus-peer.c b/gio/tests/gdbus-peer.c index 3d98846..93995dd 100644 --- a/gio/tests/gdbus-peer.c +++ b/gio/tests/gdbus-peer.c @@ -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 (); diff --git a/gio/tests/gdbus-proxy-threads.c b/gio/tests/gdbus-proxy-threads.c index f8cd3db..0e03209 100644 --- a/gio/tests/gdbus-proxy-threads.c +++ b/gio/tests/gdbus-proxy-threads.c @@ -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); } diff --git a/gio/tests/gdbus-test-codegen.c b/gio/tests/gdbus-test-codegen.c index 3aaefbe..7652615 100644 --- a/gio/tests/gdbus-test-codegen.c +++ b/gio/tests/gdbus-test-codegen.c @@ -568,7 +568,6 @@ on_name_acquired (GDBusConnection *connection, g_thread_new ("check-proxies", check_proxies_in_thread, loop, - TRUE, NULL); } diff --git a/gio/tests/gdbus-threading.c b/gio/tests/gdbus-threading.c index 71acda2..d77b578 100644 --- a/gio/tests/gdbus-threading.c +++ b/gio/tests/gdbus-threading.c @@ -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); diff --git a/gio/tests/resolver.c b/gio/tests/resolver.c index 5d432fc..3af0218 100644 --- a/gio/tests/resolver.c +++ b/gio/tests/resolver.c @@ -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 diff --git a/gio/tests/send-data.c b/gio/tests/send-data.c index 6ef9382..8d005c8 100644 --- a/gio/tests/send-data.c +++ b/gio/tests/send-data.c @@ -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 { diff --git a/gio/tests/socket-client.c b/gio/tests/socket-client.c index d3b04e2..0b49fc1 100644 --- a/gio/tests/socket-client.c +++ b/gio/tests/socket-client.c @@ -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 { diff --git a/gio/tests/socket-server.c b/gio/tests/socket-server.c index 2a442bb..2f1126c 100644 --- a/gio/tests/socket-server.c +++ b/gio/tests/socket-server.c @@ -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 { diff --git a/gio/tests/socket.c b/gio/tests/socket.c index cb306d7..3f27bcb 100644 --- a/gio/tests/socket.c +++ b/gio/tests/socket.c @@ -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; diff --git a/gio/tests/tls-interaction.c b/gio/tests/tls-interaction.c index 47eaea2..cd7866d 100644 --- a/gio/tests/tls-interaction.c +++ b/gio/tests/tls-interaction.c @@ -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); diff --git a/gio/tests/unix-streams.c b/gio/tests/unix-streams.c index be33037..6ff5877 100644 --- a/gio/tests/unix-streams.c +++ b/gio/tests/unix-streams.c @@ -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); diff --git a/glib/deprecated/gthread-deprecated.c b/glib/deprecated/gthread-deprecated.c index a52e08d..3a01799 100644 --- a/glib/deprecated/gthread-deprecated.c +++ b/glib/deprecated/gthread-deprecated.c @@ -312,16 +312,17 @@ g_deprecated_thread_proxy (gpointer data) * * This function creates a new thread. * - * If @joinable is %TRUE, you can wait for this threads termination - * calling g_thread_join(). Otherwise the thread will just disappear - * when it terminates. - * * The new thread executes the function @func with the argument @data. * If the thread was created successfully, it is returned. * * @error can be %NULL to ignore errors, or non-%NULL to report errors. * The error is set, if and only if the function returns %NULL. * + * This function returns a reference to the created thread only if + * @joinable is %TRUE. In that case, you must free this reference by + * calling g_thread_unref() or g_thread_join(). If @joinable is %FALSE + * then you should probably not touch the return value. + * * Returns: the new #GThread on success * * Deprecated:2.32: Use g_thread_new() instead @@ -332,7 +333,7 @@ g_thread_create (GThreadFunc func, gboolean joinable, GError **error) { - return g_thread_new_internal (NULL, g_deprecated_thread_proxy, func, data, joinable, 0, error); + return g_thread_create_full (func, data, 0, joinable, 0, 0, error); } /** @@ -360,10 +361,19 @@ g_thread_create_full (GThreadFunc func, GThreadPriority priority, GError **error) { - return g_thread_new_internal (NULL, g_deprecated_thread_proxy, func, data, joinable, stack_size, error); -} + GThread *thread; + thread = g_thread_new_internal (NULL, g_deprecated_thread_proxy, + func, data, stack_size, error); + if (!joinable) + { + thread->joinable = FALSE; + g_thread_unref (thread); + } + + return thread; +} /* GOnce {{{1 ------------------------------------------------------------- */ gboolean diff --git a/glib/gmain.c b/glib/gmain.c index 3cf1fa8..1a3c67a 100644 --- a/glib/gmain.c +++ b/glib/gmain.c @@ -4760,7 +4760,7 @@ g_get_worker_context (void) GError *error = NULL; glib_worker_context = g_main_context_new (); - if (g_thread_new ("gmain", glib_worker_main, NULL, FALSE, &error) == NULL) + if (g_thread_new ("gmain", glib_worker_main, NULL, &error) == NULL) g_error ("Creating GLib worker thread failed: %s\n", error->message); g_once_init_leave (&initialised, TRUE); diff --git a/glib/gthread.c b/glib/gthread.c index be3a12b..1567b5f 100644 --- a/glib/gthread.c +++ b/glib/gthread.c @@ -427,10 +427,6 @@ * Specifies the type of the @func functions passed to * g_thread_new() or g_thread_new_full(). * - * If the thread is joinable, the return value of this function - * is returned by a g_thread_join() call waiting for the thread. - * If the thread is not joinable, the return value is ignored. - * * Returns: the return value of the thread */ @@ -725,7 +721,6 @@ g_thread_proxy (gpointer data) * @name: a name for the new thread * @func: a function to execute in the new thread * @data: an argument to supply to the new thread - * @joinable: should this thread be joinable? * @error: return location for error * * This function creates a new thread. The new thread starts by invoking @@ -736,14 +731,11 @@ g_thread_proxy (gpointer data) * a debugger. Some systems restrict the length of @name to * 16 bytes. * - * If @joinable is %TRUE, you can wait for this thread's termination - * calling g_thread_join(). Resources for a joinable thread are not - * fully released until g_thread_join() is called for that thread. - * Otherwise the thread will just disappear when it terminates. - * * @error can be %NULL to ignore errors, or non-%NULL to report errors. * The error is set, if and only if the function returns %NULL. * + * You must + * * Returns: the new #GThread, or %NULL if an error occurred * * Since: 2.32 @@ -752,10 +744,9 @@ GThread * g_thread_new (const gchar *name, GThreadFunc func, gpointer data, - gboolean joinable, GError **error) { - return g_thread_new_internal (name, g_thread_proxy, func, data, joinable, 0, error); + return g_thread_new_internal (name, g_thread_proxy, func, data, 0, error); } /** @@ -763,7 +754,6 @@ g_thread_new (const gchar *name, * @name: a name for the new thread * @func: a function to execute in the new thread * @data: an argument to supply to the new thread - * @joinable: should this thread be joinable? * @stack_size: a stack size for the new thread * @error: return location for error * @@ -782,11 +772,6 @@ g_thread_new (const gchar *name, * In most cases, using g_thread_new() (which doesn't take a * @stack_size) is better. * - * If @joinable is %TRUE, you can wait for this thread's termination - * calling g_thread_join(). Resources for a joinable thread are not - * fully released until g_thread_join() is called for that thread. - * Otherwise the thread will just disappear when it terminates. - * * @error can be %NULL to ignore errors, or non-%NULL to report errors. * The error is set, if and only if the function returns %NULL. * @@ -798,11 +783,10 @@ GThread * g_thread_new_full (const gchar *name, GThreadFunc func, gpointer data, - gboolean joinable, gsize stack_size, GError **error) { - return g_thread_new_internal (name, g_thread_proxy, func, data, joinable, stack_size, error); + return g_thread_new_internal (name, g_thread_proxy, func, data, stack_size, error); } GThread * @@ -810,7 +794,6 @@ g_thread_new_internal (const gchar *name, GThreadFunc proxy, GThreadFunc func, gpointer data, - gboolean joinable, gsize stack_size, GError **error) { @@ -822,9 +805,9 @@ g_thread_new_internal (const gchar *name, thread = g_system_thread_new (proxy, stack_size, error); if (thread) { - thread->ref_count = joinable ? 2 : 1; + thread->ref_count = 2; thread->ours = TRUE; - thread->thread.joinable = joinable; + thread->thread.joinable = TRUE; thread->thread.func = func; thread->thread.data = data; thread->name = name; @@ -840,10 +823,9 @@ g_thread_new_internal (const gchar *name, * * Terminates the current thread. * - * If another thread is waiting for that thread using g_thread_join() - * and the current thread is joinable, the waiting thread will be woken - * up and get @retval as the return value of g_thread_join(). If the - * current thread is not joinable, @retval is ignored. + * If another thread is waiting for us using g_thread_join() then the + * waiting thread will be woken up and get @retval as the return value + * of g_thread_join(). * * Calling g_thread_exit (retval) is equivalent to * returning @retval from the function @func, as given to g_thread_new(). @@ -863,17 +845,16 @@ g_thread_exit (gpointer retval) /** * g_thread_join: - * @thread: a joinable #GThread + * @thread: a #GThread * * Waits until @thread finishes, i.e. the function @func, as * given to g_thread_new(), returns or g_thread_exit() is called. * If @thread has already terminated, then g_thread_join() - * returns immediately. @thread must be joinable. + * returns immediately. * - * Any thread can wait for any other (joinable) thread by calling - * g_thread_join(), not just its 'creator'. Calling g_thread_join() - * from multiple threads for the same @thread leads to undefined - * behaviour. + * Any thread can wait for any other thread by calling g_thread_join(), + * not just its 'creator'. Calling g_thread_join() from multiple threads + * for the same @thread leads to undefined behaviour. * * The value returned by @func or given to g_thread_exit() is * returned by this function. @@ -890,7 +871,6 @@ g_thread_join (GThread *thread) gpointer retval; g_return_val_if_fail (thread, NULL); - g_return_val_if_fail (thread->joinable, NULL); g_system_thread_wait (real); diff --git a/glib/gthread.h b/glib/gthread.h index 5fa3362..3b08016 100644 --- a/glib/gthread.h +++ b/glib/gthread.h @@ -142,12 +142,10 @@ void g_thread_unref (GThread *thread); GThread * g_thread_new (const gchar *name, GThreadFunc func, gpointer data, - gboolean joinable, GError **error); GThread * g_thread_new_full (const gchar *name, GThreadFunc func, gpointer data, - gboolean joinable, gsize stack_size, GError **error); GThread * g_thread_self (void); diff --git a/glib/gthreadpool.c b/glib/gthreadpool.c index 0e2340e..d2402f8 100644 --- a/glib/gthreadpool.c +++ b/glib/gthreadpool.c @@ -411,14 +411,15 @@ g_thread_pool_start_thread (GRealThreadPool *pool, if (!success) { - GError *local_error = NULL; + GThread *thread; /* No thread was found, we have to start a new one */ - if (!g_thread_new ("pool", g_thread_pool_thread_proxy, pool, FALSE, &local_error)) - { - g_propagate_error (error, local_error); - return FALSE; - } + thread = g_thread_new ("pool", g_thread_pool_thread_proxy, pool, error); + + if (thread == NULL) + return FALSE; + + g_thread_unref (thread); } /* See comment in g_thread_pool_thread_proxy as to why this is done diff --git a/glib/gthreadprivate.h b/glib/gthreadprivate.h index 27c40f2..4d7dd7c 100644 --- a/glib/gthreadprivate.h +++ b/glib/gthreadprivate.h @@ -44,13 +44,13 @@ void g_system_thread_free (GRealThread *thread); G_GNUC_INTERNAL void g_system_thread_exit (void); G_GNUC_INTERNAL void g_system_thread_set_name (const gchar *name); -G_GNUC_INTERNAL GThread *g_thread_new_internal (const gchar *name, - GThreadFunc proxy, - GThreadFunc func, - gpointer data, - gboolean joinable, - gsize stack_size, - GError **error); +G_GNUC_INTERNAL +GThread * g_thread_new_internal (const gchar *name, + GThreadFunc proxy, + GThreadFunc func, + gpointer data, + gsize stack_size, + GError **error); G_GNUC_INTERNAL gpointer g_thread_proxy (gpointer thread); diff --git a/glib/tests/once.c b/glib/tests/once.c index c59cb4d..06e811c 100644 --- a/glib/tests/once.c +++ b/glib/tests/once.c @@ -104,7 +104,7 @@ test_once3 (void) shared = 0; for (i = 0; i < THREADS; i++) - threads[i] = g_thread_new ("once3", thread_func, NULL, TRUE, NULL); + threads[i] = g_thread_new ("once3", thread_func, NULL, NULL); for (i = 0; i < THREADS; i++) g_thread_join (threads[i]); diff --git a/glib/tests/thread.c b/glib/tests/thread.c index 0b83bdf..4ac9374 100644 --- a/glib/tests/thread.c +++ b/glib/tests/thread.c @@ -50,7 +50,7 @@ test_thread1 (void) GThread *thread; GError *error = NULL; - thread = g_thread_new ("test", thread1_func, NULL, TRUE, &error); + thread = g_thread_new ("test", thread1_func, NULL, &error); g_assert_no_error (error); result = g_thread_join (thread); @@ -71,7 +71,7 @@ test_thread2 (void) gpointer result; GThread *thread; - thread = g_thread_new ("test", thread2_func, NULL, TRUE, NULL); + thread = g_thread_new ("test", thread2_func, NULL, NULL); g_assert (g_thread_self () != thread); @@ -107,9 +107,9 @@ test_thread3 (void) gpointer result; GThread *thread1, *thread2, *thread3; - thread1 = g_thread_new_full ("a", thread3_func, NULL, TRUE, 0, NULL); - thread2 = g_thread_new_full ("b", thread3_func, thread1, TRUE, 100, NULL); - thread3 = g_thread_new_full ("c", thread3_func, thread2, TRUE, 100000, NULL); + thread1 = g_thread_new_full ("a", thread3_func, NULL, 0, NULL); + thread2 = g_thread_new_full ("b", thread3_func, thread1, 100, NULL); + thread3 = g_thread_new_full ("c", thread3_func, thread2, 100000, NULL); result = g_thread_join (thread3); @@ -135,7 +135,7 @@ test_thread4 (void) g_error ("prlimit failed: %s\n", g_strerror (ret)); error = NULL; - thread = g_thread_new ("a", thread1_func, NULL, FALSE, &error); + thread = g_thread_new ("a", thread1_func, NULL, &error); g_assert (thread == NULL); g_assert_error (error, G_THREAD_ERROR, G_THREAD_ERROR_AGAIN); g_error_free (error); diff --git a/gobject/tests/dynamictests.c b/gobject/tests/dynamictests.c index 16fc925..6574235 100644 --- a/gobject/tests/dynamictests.c +++ b/gobject/tests/dynamictests.c @@ -210,7 +210,7 @@ test_multithreaded_dynamic_type_init (void) /* create threads */ for (i = 0; i < N_THREADS; i++) { - threads[i] = g_thread_new ("test", ref_unref_thread, (gpointer) DYNAMIC_OBJECT_TYPE, TRUE, NULL); + threads[i] = g_thread_new ("test", ref_unref_thread, (gpointer) DYNAMIC_OBJECT_TYPE, NULL); } /* execute threads */ diff --git a/gthread/tests/1bit-mutex.c b/gthread/tests/1bit-mutex.c index 8d98b0e..8ee492e 100644 --- a/gthread/tests/1bit-mutex.c +++ b/gthread/tests/1bit-mutex.c @@ -133,8 +133,8 @@ testcase (gconstpointer data) for (i = 0; i < THREADS; i++) threads[i] = g_thread_new ("foo", thread_func, - GINT_TO_POINTER (use_pointers), - TRUE, NULL); + GINT_TO_POINTER (use_pointers), + NULL); for (i = 0; i < THREADS; i++) g_thread_join (threads[i]); diff --git a/gthread/tests/atomic.c b/gthread/tests/atomic.c index 12f72a0..ccc9f17 100644 --- a/gthread/tests/atomic.c +++ b/gthread/tests/atomic.c @@ -47,7 +47,7 @@ test_atomic (void) bucket[i] = 0; for (i = 0; i < THREADS; i++) - threads[i] = g_thread_new ("atomic", thread_func, GINT_TO_POINTER (i), TRUE, NULL); + threads[i] = g_thread_new ("atomic", thread_func, GINT_TO_POINTER (i), NULL); for (i = 0; i < THREADS; i++) g_thread_join (threads[i]); diff --git a/gthread/tests/gwakeuptest.c b/gthread/tests/gwakeuptest.c index 3da5753..92eec72 100644 --- a/gthread/tests/gwakeuptest.c +++ b/gthread/tests/gwakeuptest.c @@ -229,7 +229,7 @@ test_threaded (void) for (i = 0; i < NUM_THREADS; i++) { context_init (&contexts[i]); - threads[i] = g_thread_new ("test", thread_func, &contexts[i], TRUE, NULL); + threads[i] = g_thread_new ("test", thread_func, &contexts[i], NULL); } /* dispatch tokens */ diff --git a/gthread/tests/spawn-multithreaded.c b/gthread/tests/spawn-multithreaded.c index 119012f..df29abd 100644 --- a/gthread/tests/spawn-multithreaded.c +++ b/gthread/tests/spawn-multithreaded.c @@ -41,8 +41,7 @@ multithreaded_test_run (GThreadFunc function) { GThread *thread; - thread = g_thread_new ("test", function, - GINT_TO_POINTER (i), TRUE, &error); + thread = g_thread_new ("test", function, GINT_TO_POINTER (i), &error); g_assert_no_error (error); g_ptr_array_add (threads, thread); } -- 2.7.4