diff options
author | Tuomas Taipale <tuomas.taipale@nokia.com> | 2024-04-23 05:38:14 +0000 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2024-04-26 13:23:20 +0300 |
commit | 7e5bea387b0815e0d7358da1f0a6d768629c267d (patch) | |
tree | 3def96807b1a4d22a09b40bcb897517ef91b6f2b /test | |
parent | f1c3f2d2780682ea0a359bb9c55eb5c50dac90ea (diff) |
test: common: utilize new join function
Utilize new `odph_thread_join_result()` to check the return values of
joined threads.
Signed-off-by: Tuomas Taipale <tuomas.taipale@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/common/odp_cunit_common.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/test/common/odp_cunit_common.c b/test/common/odp_cunit_common.c index 23587faa0..e3c83dd9f 100644 --- a/test/common/odp_cunit_common.c +++ b/test/common/odp_cunit_common.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2014-2018 Linaro Limited - * Copyright (c) 2019-2022 Nokia + * Copyright (c) 2019-2024 Nokia * Copyright (c) 2021 Marvell */ @@ -242,14 +242,25 @@ int odp_cunit_thread_create(int num, int func_ptr(void *), void *const arg[], in int odp_cunit_thread_join(int num) { + odph_thread_join_result_t res[num]; + /* Wait for threads to exit */ - if (odph_thread_join(thread_tbl, num) != num) { - fprintf(stderr, "error: odph_thread_join() failed.\n"); + if (odph_thread_join_result(thread_tbl, res, num) != num) { + fprintf(stderr, "error: odph_thread_join_result() failed.\n"); return -1; } + threads_running = 0; thread_func = 0; + for (int i = 0; i < num; i++) { + if (res[i].is_sig || res[i].ret != 0) { + fprintf(stderr, "error: worker thread failure%s: %d.\n", res[i].is_sig ? + " (signaled)" : "", res[i].ret); + return -1; + } + } + handle_postponed_asserts(); return 0; |