[glib: 9/10] tests: Port GObject tests from g_thread_create() to g_thread_new()




commit ed84b8f4688b76cb56bab31890b038959720f54f
Author: Philip Withnall <pwithnall endlessos org>
Date:   Thu May 26 18:34:06 2022 +0100

    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

 gobject/tests/objects-refcount1.c    | 4 ++--
 gobject/tests/properties-refcount1.c | 2 +-
 gobject/tests/properties-refcount3.c | 2 +-
 gobject/tests/signals-refcount.c     | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/gobject/tests/objects-refcount1.c b/gobject/tests/objects-refcount1.c
index 0d8e20b036..8f99d06e63 100644
--- a/gobject/tests/objects-refcount1.c
+++ b/gobject/tests/objects-refcount1.c
@@ -129,10 +129,10 @@ test_refcount_object_basics (void)
   for (i = 0; i < n_threads; i++) {
     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);
 
-    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);
   }
 
diff --git a/gobject/tests/properties-refcount1.c b/gobject/tests/properties-refcount1.c
index 42176e9230..5a96518dc2 100644
--- a/gobject/tests/properties-refcount1.c
+++ b/gobject/tests/properties-refcount1.c
@@ -210,7 +210,7 @@ test_refcount_properties_1 (void)
   g_atomic_int_set (&stopping, FALSE);
 
   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);
 
diff --git a/gobject/tests/properties-refcount3.c b/gobject/tests/properties-refcount3.c
index 8a96fb8041..19b5178a72 100644
--- a/gobject/tests/properties-refcount3.c
+++ b/gobject/tests/properties-refcount3.c
@@ -172,7 +172,7 @@ test_refcount_properties_3 (void)
   for (i = 0; i < n_threads; i++) {
     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_usleep (30000000);
diff --git a/gobject/tests/signals-refcount.c b/gobject/tests/signals-refcount.c
index a9c11e32e4..c1a5745b8d 100644
--- a/gobject/tests/signals-refcount.c
+++ b/gobject/tests/signals-refcount.c
@@ -275,10 +275,10 @@ test_refcount_signals (void)
   for (i = 0; i < n_threads; i++) {
     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);
 
-    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_usleep (5000000);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]