From 75b36dbe0237947873eb693401b0951ee78911d9 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 15 Nov 2023 11:26:22 +0200 Subject: [PATCH 1/6] api: thread: move ODP_THREAD_COUNT_MAX to types header Move ODP_THREAD_COUNT_MAX specification and definition to thread_types headers where they belong to. No functional API changes. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Jerin Jacob --- include/Makefile.am | 8 ++++++ include/odp/api/abi-default/thread.h | 16 +----------- include/odp/api/abi-default/thread_types.h | 26 +++++++++++++++++++ include/odp/api/spec/init.h | 2 +- include/odp/api/spec/thread.h | 9 ++----- include/odp/api/spec/thread_types.h | 7 +++++ include/odp/api/thread.h | 2 -- include/odp/api/thread_types.h | 26 +++++++++++++++++++ .../arm32-linux/odp/api/abi/thread_types.h | 5 ++++ .../arm64-linux/odp/api/abi/thread_types.h | 5 ++++ .../default-linux/odp/api/abi/thread_types.h | 5 ++++ .../power64-linux/odp/api/abi/thread_types.h | 5 ++++ .../x86_32-linux/odp/api/abi/thread_types.h | 5 ++++ .../x86_64-linux/odp/api/abi/thread_types.h | 5 ++++ platform/linux-generic/Makefile.am | 1 + .../include-abi/odp/api/abi/thread.h | 3 +-- .../include-abi/odp/api/abi/thread_types.h | 5 ++++ .../odp/api/plat/thread_inline_types.h | 2 +- .../include/odp/api/plat/thread_inlines.h | 8 +++--- 19 files changed, 113 insertions(+), 32 deletions(-) create mode 100644 include/odp/api/abi-default/thread_types.h create mode 100644 include/odp/api/thread_types.h create mode 100644 include/odp/arch/arm32-linux/odp/api/abi/thread_types.h create mode 100644 include/odp/arch/arm64-linux/odp/api/abi/thread_types.h create mode 100644 include/odp/arch/default-linux/odp/api/abi/thread_types.h create mode 100644 include/odp/arch/power64-linux/odp/api/abi/thread_types.h create mode 100644 include/odp/arch/x86_32-linux/odp/api/abi/thread_types.h create mode 100644 include/odp/arch/x86_64-linux/odp/api/abi/thread_types.h create mode 100644 platform/linux-generic/include-abi/odp/api/abi/thread_types.h diff --git a/include/Makefile.am b/include/Makefile.am index ea3f17adde..bc28a5cba0 100644 --- a/include/Makefile.am +++ b/include/Makefile.am @@ -64,6 +64,7 @@ odpapiinclude_HEADERS = \ odp/api/sync.h \ odp/api/system_info.h \ odp/api/thread.h \ + odp/api/thread_types.h \ odp/api/threshold.h \ odp/api/thrmask.h \ odp/api/ticketlock.h \ @@ -193,6 +194,7 @@ odpapiabidefaultinclude_HEADERS = \ odp/api/abi-default/std_types.h \ odp/api/abi-default/sync.h \ odp/api/abi-default/thread.h \ + odp/api/abi-default/thread_types.h \ odp/api/abi-default/thrmask.h \ odp/api/abi-default/ticketlock.h \ odp/api/abi-default/time.h \ @@ -255,6 +257,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/arm32-linux/odp/api/abi/std_types.h \ odp/arch/arm32-linux/odp/api/abi/sync.h \ odp/arch/arm32-linux/odp/api/abi/thread.h \ + odp/arch/arm32-linux/odp/api/abi/thread_types.h \ odp/arch/arm32-linux/odp/api/abi/thrmask.h \ odp/arch/arm32-linux/odp/api/abi/ticketlock.h \ odp/arch/arm32-linux/odp/api/abi/time.h \ @@ -313,6 +316,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/arm64-linux/odp/api/abi/std_types.h \ odp/arch/arm64-linux/odp/api/abi/sync.h \ odp/arch/arm64-linux/odp/api/abi/thread.h \ + odp/arch/arm64-linux/odp/api/abi/thread_types.h \ odp/arch/arm64-linux/odp/api/abi/thrmask.h \ odp/arch/arm64-linux/odp/api/abi/ticketlock.h \ odp/arch/arm64-linux/odp/api/abi/time.h \ @@ -371,6 +375,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/default-linux/odp/api/abi/std_types.h \ odp/arch/default-linux/odp/api/abi/sync.h \ odp/arch/default-linux/odp/api/abi/thread.h \ + odp/arch/default-linux/odp/api/abi/thread_types.h \ odp/arch/default-linux/odp/api/abi/thrmask.h \ odp/arch/default-linux/odp/api/abi/ticketlock.h \ odp/arch/default-linux/odp/api/abi/time.h \ @@ -429,6 +434,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/power64-linux/odp/api/abi/std_types.h \ odp/arch/power64-linux/odp/api/abi/sync.h \ odp/arch/power64-linux/odp/api/abi/thread.h \ + odp/arch/power64-linux/odp/api/abi/thread_types.h \ odp/arch/power64-linux/odp/api/abi/thrmask.h \ odp/arch/power64-linux/odp/api/abi/ticketlock.h \ odp/arch/power64-linux/odp/api/abi/time.h \ @@ -487,6 +493,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/x86_32-linux/odp/api/abi/std_types.h \ odp/arch/x86_32-linux/odp/api/abi/sync.h \ odp/arch/x86_32-linux/odp/api/abi/thread.h \ + odp/arch/x86_32-linux/odp/api/abi/thread_types.h \ odp/arch/x86_32-linux/odp/api/abi/thrmask.h \ odp/arch/x86_32-linux/odp/api/abi/ticketlock.h \ odp/arch/x86_32-linux/odp/api/abi/time.h \ @@ -545,6 +552,7 @@ odpapiabiarchinclude_HEADERS = \ odp/arch/x86_64-linux/odp/api/abi/std_types.h \ odp/arch/x86_64-linux/odp/api/abi/sync.h \ odp/arch/x86_64-linux/odp/api/abi/thread.h \ + odp/arch/x86_64-linux/odp/api/abi/thread_types.h \ odp/arch/x86_64-linux/odp/api/abi/thrmask.h \ odp/arch/x86_64-linux/odp/api/abi/ticketlock.h \ odp/arch/x86_64-linux/odp/api/abi/time.h \ diff --git a/include/odp/api/abi-default/thread.h b/include/odp/api/abi-default/thread.h index 3113278d3f..3b7ce41dca 100644 --- a/include/odp/api/abi-default/thread.h +++ b/include/odp/api/abi-default/thread.h @@ -2,12 +2,6 @@ * Copyright (c) 2015-2018 Linaro Limited */ -/** - * @file - * - * ODP thread - */ - #ifndef ODP_ABI_THREAD_H_ #define ODP_ABI_THREAD_H_ @@ -15,15 +9,7 @@ extern "C" { #endif -/** @addtogroup odp_thread - * @{ - */ - -#define ODP_THREAD_COUNT_MAX 256 - -/** - * @} - */ +/* Empty header required due to the inline functions */ #ifdef __cplusplus } diff --git a/include/odp/api/abi-default/thread_types.h b/include/odp/api/abi-default/thread_types.h new file mode 100644 index 0000000000..1511f488d2 --- /dev/null +++ b/include/odp/api/abi-default/thread_types.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#ifndef ODP_ABI_THREAD_TYPES_H_ +#define ODP_ABI_THREAD_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +/** @ingroup odp_thread + * @{ + */ + +#define ODP_THREAD_COUNT_MAX 256 + +/** + * @} + */ + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/odp/api/spec/init.h b/include/odp/api/spec/init.h index f0491ad5b6..ee787665f4 100644 --- a/include/odp/api/spec/init.h +++ b/include/odp/api/spec/init.h @@ -17,7 +17,7 @@ extern "C" { #include #include -#include +#include #include /** @defgroup odp_initialization ODP INITIALIZATION diff --git a/include/odp/api/spec/thread.h b/include/odp/api/spec/thread.h index d595a95631..abe7a6eb40 100644 --- a/include/odp/api/spec/thread.h +++ b/include/odp/api/spec/thread.h @@ -17,18 +17,13 @@ extern "C" { #endif +#include + /** @defgroup odp_thread ODP THREAD * Thread types, masks and IDs. * @{ */ -/** - * @def ODP_THREAD_COUNT_MAX - * Maximum number of threads supported in build time. Use - * odp_thread_count_max() for maximum number of threads supported in run time, - * which depend on system configuration and may be lower than this number. - */ - /** * Get thread identifier * diff --git a/include/odp/api/spec/thread_types.h b/include/odp/api/spec/thread_types.h index 60cf4897b0..204d28cadb 100644 --- a/include/odp/api/spec/thread_types.h +++ b/include/odp/api/spec/thread_types.h @@ -19,6 +19,13 @@ extern "C" { * @{ */ +/** + * @def ODP_THREAD_COUNT_MAX + * Maximum number of threads supported in build time. Use odp_thread_count_max() + * for maximum number of threads supported in run time, which depends on system + * configuration and may be lower than this number. + */ + /** * Thread type */ diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h index 2e02888863..24199a1661 100644 --- a/include/odp/api/thread.h +++ b/include/odp/api/thread.h @@ -15,8 +15,6 @@ extern "C" { #endif -#include - #include #include diff --git a/include/odp/api/thread_types.h b/include/odp/api/thread_types.h new file mode 100644 index 0000000000..54ea5b7149 --- /dev/null +++ b/include/odp/api/thread_types.h @@ -0,0 +1,26 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +/** + * @file + * + * ODP thread + */ + +#ifndef ODP_API_THREAD_TYPES_H_ +#define ODP_API_THREAD_TYPES_H_ + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +#include + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/include/odp/arch/arm32-linux/odp/api/abi/thread_types.h b/include/odp/arch/arm32-linux/odp/api/abi/thread_types.h new file mode 100644 index 0000000000..e695c233bd --- /dev/null +++ b/include/odp/arch/arm32-linux/odp/api/abi/thread_types.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#include diff --git a/include/odp/arch/arm64-linux/odp/api/abi/thread_types.h b/include/odp/arch/arm64-linux/odp/api/abi/thread_types.h new file mode 100644 index 0000000000..e695c233bd --- /dev/null +++ b/include/odp/arch/arm64-linux/odp/api/abi/thread_types.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#include diff --git a/include/odp/arch/default-linux/odp/api/abi/thread_types.h b/include/odp/arch/default-linux/odp/api/abi/thread_types.h new file mode 100644 index 0000000000..e695c233bd --- /dev/null +++ b/include/odp/arch/default-linux/odp/api/abi/thread_types.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#include diff --git a/include/odp/arch/power64-linux/odp/api/abi/thread_types.h b/include/odp/arch/power64-linux/odp/api/abi/thread_types.h new file mode 100644 index 0000000000..e695c233bd --- /dev/null +++ b/include/odp/arch/power64-linux/odp/api/abi/thread_types.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#include diff --git a/include/odp/arch/x86_32-linux/odp/api/abi/thread_types.h b/include/odp/arch/x86_32-linux/odp/api/abi/thread_types.h new file mode 100644 index 0000000000..e695c233bd --- /dev/null +++ b/include/odp/arch/x86_32-linux/odp/api/abi/thread_types.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#include diff --git a/include/odp/arch/x86_64-linux/odp/api/abi/thread_types.h b/include/odp/arch/x86_64-linux/odp/api/abi/thread_types.h new file mode 100644 index 0000000000..e695c233bd --- /dev/null +++ b/include/odp/arch/x86_64-linux/odp/api/abi/thread_types.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#include diff --git a/platform/linux-generic/Makefile.am b/platform/linux-generic/Makefile.am index 3b645460bf..f3707ab3a3 100644 --- a/platform/linux-generic/Makefile.am +++ b/platform/linux-generic/Makefile.am @@ -115,6 +115,7 @@ odpapiabiarchinclude_HEADERS += \ include-abi/odp/api/abi/std_types.h \ include-abi/odp/api/abi/sync.h \ include-abi/odp/api/abi/thread.h \ + include-abi/odp/api/abi/thread_types.h \ include-abi/odp/api/abi/thrmask.h \ include-abi/odp/api/abi/ticketlock.h \ include-abi/odp/api/abi/time.h \ diff --git a/platform/linux-generic/include-abi/odp/api/abi/thread.h b/platform/linux-generic/include-abi/odp/api/abi/thread.h index d5628a740e..14c074b955 100644 --- a/platform/linux-generic/include-abi/odp/api/abi/thread.h +++ b/platform/linux-generic/include-abi/odp/api/abi/thread.h @@ -4,6 +4,5 @@ * SPDX-License-Identifier: BSD-3-Clause */ -#include - +/* Inlined API functions */ #include diff --git a/platform/linux-generic/include-abi/odp/api/abi/thread_types.h b/platform/linux-generic/include-abi/odp/api/abi/thread_types.h new file mode 100644 index 0000000000..e695c233bd --- /dev/null +++ b/platform/linux-generic/include-abi/odp/api/abi/thread_types.h @@ -0,0 +1,5 @@ +/* SPDX-License-Identifier: BSD-3-Clause + * Copyright (c) 2023 Nokia + */ + +#include diff --git a/platform/linux-generic/include/odp/api/plat/thread_inline_types.h b/platform/linux-generic/include/odp/api/plat/thread_inline_types.h index c9a15b06b8..d24263fa7a 100644 --- a/platform/linux-generic/include/odp/api/plat/thread_inline_types.h +++ b/platform/linux-generic/include/odp/api/plat/thread_inline_types.h @@ -9,7 +9,7 @@ #define ODP_PLAT_THREAD_INLINE_TYPES_H_ #include -#include +#include #ifdef __cplusplus extern "C" { diff --git a/platform/linux-generic/include/odp/api/plat/thread_inlines.h b/platform/linux-generic/include/odp/api/plat/thread_inlines.h index 2f2e50b06a..2b6957064a 100644 --- a/platform/linux-generic/include/odp/api/plat/thread_inlines.h +++ b/platform/linux-generic/include/odp/api/plat/thread_inlines.h @@ -7,14 +7,14 @@ #ifndef ODP_PLAT_THREAD_INLINES_H_ #define ODP_PLAT_THREAD_INLINES_H_ -#include - -#include - #ifdef __cplusplus extern "C" { #endif +#include + +#include + /** @cond _ODP_HIDE_FROM_DOXYGEN_ */ #ifndef _ODP_NO_INLINE From 16e04d0ac820c93eca5302ec9208f17d6e03260c Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 15 Nov 2023 11:49:14 +0200 Subject: [PATCH 2/6] api: thread: add functions for reading maximum control/worker thread count Add new functions odp_thread_control_count_max() and odp_thread_worker_count_max() for reading the maximum number of control and worker threads. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Jerin Jacob --- include/odp/api/spec/thread.h | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/include/odp/api/spec/thread.h b/include/odp/api/spec/thread.h index abe7a6eb40..29db89c473 100644 --- a/include/odp/api/spec/thread.h +++ b/include/odp/api/spec/thread.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: BSD-3-Clause * Copyright (c) 2013-2018 Linaro Limited - * Copyright (c) 2022 Nokia + * Copyright (c) 2022-2023 Nokia */ /** @@ -54,13 +54,36 @@ int odp_thread_count(void); /** * Maximum thread count * - * Returns the maximum thread count, which is a constant value and set in - * ODP initialization phase. This may be lower than ODP_THREAD_COUNT_MAX. + * Returns the maximum number of threads of any type. This is a constant value + * and set in ODP initialization phase. The value may be lower than + * #ODP_THREAD_COUNT_MAX. * * @return Maximum thread count */ int odp_thread_count_max(void); +/** + * Maximum control thread count + * + * Otherwise like odp_thread_count_max(), but returns the maximum number of + * control threads (#ODP_THREAD_CONTROL). The returned value is always <= + * odp_thread_count_max(). + * + * @return Maximum control thread count + */ +int odp_thread_control_count_max(void); + +/** + * Maximum worker thread count + * + * Otherwise like odp_thread_count_max(), but returns the maximum number of + * worker threads (#ODP_THREAD_WORKER). The returned value is always <= + * odp_thread_count_max(). + * + * @return Maximum worker thread count + */ +int odp_thread_worker_count_max(void); + /** * Thread type * From ca6836eb533ae13f0eae20f6b26328cff060b008 Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 15 Nov 2023 12:28:38 +0200 Subject: [PATCH 3/6] api: thread: add functions for reading current control/worker thread count Add new functions odp_thread_control_count() and odp_thread_worker_count() for reading the current number of control and worker threads. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale Reviewed-by: Jerin Jacob --- include/odp/api/spec/thread.h | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/include/odp/api/spec/thread.h b/include/odp/api/spec/thread.h index 29db89c473..dbb033da1d 100644 --- a/include/odp/api/spec/thread.h +++ b/include/odp/api/spec/thread.h @@ -43,14 +43,36 @@ int odp_thread_id(void); * Thread count * * Returns the current ODP thread count. This is the number of active threads - * running the ODP instance. Each odp_init_local() call increments and each - * odp_term_local() call decrements the count. The count is always between 1 and - * odp_thread_count_max(). + * of any type running in the ODP instance. Each odp_init_local() call + * increments and each odp_term_local() call decrements the count. The count is + * always between 1 and odp_thread_count_max(). * * @return Current thread count */ int odp_thread_count(void); +/** + * Control thread count + * + * Otherwise like odp_thread_count(), but returns the number of active threads + * of type #ODP_THREAD_CONTROL. The count is always between 0 and + * odp_thread_control_count_max(). + * + * @return Current control thread count + */ +int odp_thread_control_count(void); + +/** + * Worker thread count + * + * Otherwise like odp_thread_count(), but returns the number of active threads + * of type #ODP_THREAD_WORKER. The count is always between 0 and + * odp_thread_worker_count_max(). + * + * @return Current worker thread count + */ +int odp_thread_worker_count(void); + /** * Maximum thread count * From f31ed165e39c2ea6db93c9ba8450a788aed479ca Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 15 Nov 2023 13:26:30 +0200 Subject: [PATCH 4/6] linux-gen: thread: implement current control/worker thread count functions Implement new functions odp_thread_control_count() and odp_thread_worker_count() for reading the current number of control and worker threads. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- platform/linux-generic/odp_thread.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index bdfd758d71..2fa30f4887 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -257,6 +257,16 @@ int odp_thread_count(void) return thread_globals->num; } +int odp_thread_control_count(void) +{ + return thread_globals->num_control; +} + +int odp_thread_worker_count(void) +{ + return thread_globals->num_worker; +} + int odp_thread_count_max(void) { return thread_globals->num_max; From 5eb0f93234b5b116d77f71521881eb2300bec82c Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 15 Nov 2023 13:35:01 +0200 Subject: [PATCH 5/6] linux-gen: thread: implement max control/worker thread count functions Implement new functions odp_thread_control_count_max() and odp_thread_worker_count_max() for reading the maximum number of control and worker threads. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- platform/linux-generic/odp_thread.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/platform/linux-generic/odp_thread.c b/platform/linux-generic/odp_thread.c index 2fa30f4887..88aec8f060 100644 --- a/platform/linux-generic/odp_thread.c +++ b/platform/linux-generic/odp_thread.c @@ -272,6 +272,16 @@ int odp_thread_count_max(void) return thread_globals->num_max; } +int odp_thread_control_count_max(void) +{ + return thread_globals->num_max; +} + +int odp_thread_worker_count_max(void) +{ + return thread_globals->num_max; +} + int odp_thrmask_worker(odp_thrmask_t *mask) { odp_thrmask_copy(mask, &thread_globals->worker); From a7713635542833f1287cd54df60b0efc3a037c1d Mon Sep 17 00:00:00 2001 From: Matias Elo Date: Wed, 15 Nov 2023 13:58:19 +0200 Subject: [PATCH 6/6] validation: thread: add tests for new control/worker thread count functions Add validation tests for the new control/worker thread count functions. Signed-off-by: Matias Elo Reviewed-by: Tuomas Taipale --- test/validation/api/thread/thread.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/test/validation/api/thread/thread.c b/test/validation/api/thread/thread.c index 87c23e74e3..840256fcf2 100644 --- a/test/validation/api/thread/thread.c +++ b/test/validation/api/thread/thread.c @@ -104,13 +104,31 @@ static void thread_test_odp_thread_count(void) { int count = odp_thread_count(); - /* One thread running */ + /* One control thread running */ CU_ASSERT(count == 1); + CU_ASSERT(odp_thread_control_count() == 1); + CU_ASSERT(odp_thread_control_count() <= odp_thread_control_count_max()); + CU_ASSERT(odp_thread_worker_count() == 0); CU_ASSERT(count >= 1); CU_ASSERT(count <= odp_thread_count_max()); CU_ASSERT(count <= ODP_THREAD_COUNT_MAX); - CU_ASSERT(odp_thread_count_max() <= ODP_THREAD_COUNT_MAX); +} + +static void thread_test_odp_thread_count_max(void) +{ + int max_threads = odp_thread_count_max(); + int max_control = odp_thread_control_count_max(); + int max_worker = odp_thread_worker_count_max(); + + CU_ASSERT(max_threads > 0); + CU_ASSERT(max_threads <= ODP_THREAD_COUNT_MAX); + + CU_ASSERT(max_control >= 0); + CU_ASSERT(max_control <= max_threads); + + CU_ASSERT(max_worker >= 0); + CU_ASSERT(max_worker <= max_threads); } static int thread_func(void *arg) @@ -175,7 +193,9 @@ static void thread_test_odp_thrmask_worker(void) ret = odp_thrmask_worker(&mask); CU_ASSERT(ret == odp_thrmask_count(&mask)); CU_ASSERT(ret == num); + CU_ASSERT(ret == odp_thread_worker_count()); CU_ASSERT(ret <= odp_thread_count_max()); + CU_ASSERT(ret <= odp_thread_worker_count_max()); /* allow thread(s) to exit */ odp_barrier_wait(&global_mem->bar_exit); @@ -194,9 +214,10 @@ static void thread_test_odp_thrmask_control(void) CU_ASSERT(odp_thread_type() == ODP_THREAD_CONTROL); - /* should start out with 1 worker thread */ + /* Should start out with 1 control thread */ ret = odp_thrmask_control(&mask); CU_ASSERT(ret == odp_thrmask_count(&mask)); + CU_ASSERT(ret == odp_thread_control_count()); CU_ASSERT(ret == 1); } @@ -204,6 +225,7 @@ odp_testinfo_t thread_suite[] = { ODP_TEST_INFO(thread_test_odp_cpu_id), ODP_TEST_INFO(thread_test_odp_thread_id), ODP_TEST_INFO(thread_test_odp_thread_count), + ODP_TEST_INFO(thread_test_odp_thread_count_max), ODP_TEST_INFO(thread_test_odp_thrmask_to_from_str), ODP_TEST_INFO(thread_test_odp_thrmask_equal), ODP_TEST_INFO(thread_test_odp_thrmask_zero),