diff options
author | Ryan Lortie <desrt@desrt.ca> | 2011-10-13 01:00:57 -0400 |
---|---|---|
committer | Ryan Lortie <desrt@desrt.ca> | 2011-10-13 01:00:57 -0400 |
commit | 430c5635f245ca485f09035f1b6c3a59dd69758c (patch) | |
tree | a3b745d9c991565a087d157522ebf3b3175497e6 /gthread | |
parent | 015f4b4513279c4be40c03121473ffcea347ed84 (diff) |
g_thread_new: never fail
Remove the GError argument from g_thread_new() and abort on failure.
Introduce g_thread_try() for those who want to handle failure.
Diffstat (limited to 'gthread')
-rw-r--r-- | gthread/tests/1bit-mutex.c | 3 | ||||
-rw-r--r-- | gthread/tests/atomic.c | 2 | ||||
-rw-r--r-- | gthread/tests/gwakeuptest.c | 2 | ||||
-rw-r--r-- | gthread/tests/spawn-multithreaded.c | 6 |
4 files changed, 5 insertions, 8 deletions
diff --git a/gthread/tests/1bit-mutex.c b/gthread/tests/1bit-mutex.c index 8ee492ed9..c1ec41c95 100644 --- a/gthread/tests/1bit-mutex.c +++ b/gthread/tests/1bit-mutex.c @@ -133,8 +133,7 @@ testcase (gconstpointer data) for (i = 0; i < THREADS; i++) threads[i] = g_thread_new ("foo", thread_func, - GINT_TO_POINTER (use_pointers), - NULL); + GINT_TO_POINTER (use_pointers)); for (i = 0; i < THREADS; i++) g_thread_join (threads[i]); diff --git a/gthread/tests/atomic.c b/gthread/tests/atomic.c index ccc9f17ec..a9a66ea28 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), NULL); + threads[i] = g_thread_new ("atomic", thread_func, GINT_TO_POINTER (i)); for (i = 0; i < THREADS; i++) g_thread_join (threads[i]); diff --git a/gthread/tests/gwakeuptest.c b/gthread/tests/gwakeuptest.c index 92eec72d7..c15dcdc62 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], NULL); + threads[i] = g_thread_new ("test", thread_func, &contexts[i]); } /* dispatch tokens */ diff --git a/gthread/tests/spawn-multithreaded.c b/gthread/tests/spawn-multithreaded.c index df29abdb0..534766b2a 100644 --- a/gthread/tests/spawn-multithreaded.c +++ b/gthread/tests/spawn-multithreaded.c @@ -34,18 +34,16 @@ static void multithreaded_test_run (GThreadFunc function) { int i; - GError *error = NULL; GPtrArray *threads = g_ptr_array_new (); for (i = 0; i < N_THREADS; i++) { GThread *thread; - thread = g_thread_new ("test", function, GINT_TO_POINTER (i), &error); - g_assert_no_error (error); + thread = g_thread_new ("test", function, GINT_TO_POINTER (i)); g_ptr_array_add (threads, thread); } - + for (i = 0; i < N_THREADS; i++) { gpointer ret; |