tests: Port GObject tests from g_thread_create() to g_thread_new()

To avoid warnings about deprecated functions.

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>

Helps: #1434
This commit is contained in:
Philip Withnall 2022-05-26 18:34:06 +01:00
parent 70401ae8c3
commit ed84b8f468
4 changed files with 6 additions and 6 deletions

View File

@ -129,10 +129,10 @@ test_refcount_object_basics (void)
for (i = 0; i < n_threads; i++) { for (i = 0; i < n_threads; i++) {
GThread *thread; GThread *thread;
thread = g_thread_create ((GThreadFunc) run_thread, test1, TRUE, NULL); thread = g_thread_new (NULL, (GThreadFunc) run_thread, test1);
g_array_append_val (test_threads, thread); g_array_append_val (test_threads, thread);
thread = g_thread_create ((GThreadFunc) run_thread, test2, TRUE, NULL); thread = g_thread_new (NULL, (GThreadFunc) run_thread, test2);
g_array_append_val (test_threads, thread); g_array_append_val (test_threads, thread);
} }

View File

@ -210,7 +210,7 @@ test_refcount_properties_1 (void)
g_atomic_int_set (&stopping, FALSE); g_atomic_int_set (&stopping, FALSE);
for (i = 0; i < N_THREADS; i++) for (i = 0; i < N_THREADS; i++)
test_threads[i] = g_thread_create ((GThreadFunc) run_thread, test_objects[i], TRUE, NULL); test_threads[i] = g_thread_new (NULL, (GThreadFunc) run_thread, test_objects[i]);
g_usleep (3000000); g_usleep (3000000);

View File

@ -172,7 +172,7 @@ test_refcount_properties_3 (void)
for (i = 0; i < n_threads; i++) { for (i = 0; i < n_threads; i++) {
GThread *thread; GThread *thread;
thread = g_thread_create ((GThreadFunc) run_thread, test, TRUE, NULL); thread = g_thread_new (NULL, (GThreadFunc) run_thread, test);
g_array_append_val (test_threads, thread); g_array_append_val (test_threads, thread);
} }
g_usleep (30000000); g_usleep (30000000);

View File

@ -275,10 +275,10 @@ test_refcount_signals (void)
for (i = 0; i < n_threads; i++) { for (i = 0; i < n_threads; i++) {
GThread *thread; GThread *thread;
thread = g_thread_create ((GThreadFunc) run_thread, test1, TRUE, NULL); thread = g_thread_new (NULL, (GThreadFunc) run_thread, test1);
g_array_append_val (test_threads, thread); g_array_append_val (test_threads, thread);
thread = g_thread_create ((GThreadFunc) run_thread, test2, TRUE, NULL); thread = g_thread_new (NULL, (GThreadFunc) run_thread, test2);
g_array_append_val (test_threads, thread); g_array_append_val (test_threads, thread);
} }
g_usleep (5000000); g_usleep (5000000);