diff options
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; |