diff options
author | Jere Leppänen <jere.leppanen@nokia.com> | 2021-08-10 15:36:15 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2021-09-30 11:10:11 +0300 |
commit | 735e84f433d0eb8be225e308eeccf958a1d64ea7 (patch) | |
tree | 10e2ac7124e781153fa238dff934c16796107a8b /helper | |
parent | 17dab693309bd6beea145ecf1edbe81c289b9f4d (diff) |
helper: threads: add odph_thread_common_param_init()
Add helper API function to initialize thread common parameters.
Signed-off-by: Jere Leppänen <jere.leppanen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Diffstat (limited to 'helper')
-rw-r--r-- | helper/include/odp/helper/threads.h | 10 | ||||
-rw-r--r-- | helper/threads.c | 5 |
2 files changed, 15 insertions, 0 deletions
diff --git a/helper/include/odp/helper/threads.h b/helper/include/odp/helper/threads.h index 34f539f1a..5cd614eac 100644 --- a/helper/include/odp/helper/threads.h +++ b/helper/include/odp/helper/threads.h @@ -179,6 +179,16 @@ typedef struct { } odph_thread_common_param_t; /** + * Initialize thread common params + * + * Initialize an odph_thread_common_param_t to its default values for all + * fields. + * + * @param[out] param Pointer to parameter structure + */ +void odph_thread_common_param_init(odph_thread_common_param_t *param); + +/** * Create and pin threads (as Linux pthreads or processes) * * This is an updated version of odph_odpthreads_create() call. It may be called diff --git a/helper/threads.c b/helper/threads.c index f8244a89b..38c1293c1 100644 --- a/helper/threads.c +++ b/helper/threads.c @@ -224,6 +224,11 @@ static int wait_pthread(odph_thread_t *thread) return 0; } +void odph_thread_common_param_init(odph_thread_common_param_t *param) +{ + memset(param, 0, sizeof(*param)); +} + int odph_thread_create(odph_thread_t thread[], const odph_thread_common_param_t *param, const odph_thread_param_t thr_param[], |