aboutsummaryrefslogtreecommitdiff
path: root/helper
diff options
context:
space:
mode:
authorJere Leppänen <jere.leppanen@nokia.com>2021-09-29 14:22:35 +0300
committerMatias Elo <matias.elo@nokia.com>2021-11-12 09:48:41 +0200
commit7ecdf0cf813a391cd2e4e1847675ecca1b5e474b (patch)
tree7cbca4a0502e64d8669674516c09c5db7c338393 /helper
parent7bef61ebe885c6a089d1cd7b3f7f3b6bdf7b8cf7 (diff)
helper: threads: deprecate old functions and parameters
Deprecate odph_thread_param_t::instance, odph_odpthread_t, odph_odpthread_params_t, odph_odpthreads_create() and odph_odpthreads_join(). 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.h18
-rw-r--r--helper/threads.c16
2 files changed, 20 insertions, 14 deletions
diff --git a/helper/include/odp/helper/threads.h b/helper/include/odp/helper/threads.h
index d7cb0ac2a..f16626abf 100644
--- a/helper/include/odp/helper/threads.h
+++ b/helper/include/odp/helper/threads.h
@@ -23,6 +23,8 @@
extern "C" {
#endif
+#include <odp/helper/deprecated.h>
+
#include <pthread.h>
#include <getopt.h>
#include <sys/types.h>
@@ -67,7 +69,7 @@ typedef struct {
odp_thread_type_t thr_type;
/** @deprecated ODP instance handle for odph_odpthreads_create(). */
- odp_instance_t instance;
+ odp_instance_t ODPH_DEPRECATE(instance);
/**
* Minimum stack size in bytes. 0 = use default. Ignored by
@@ -128,10 +130,10 @@ typedef struct {
} odph_helper_options_t;
/** @deprecated Legacy thread table entry */
-typedef odph_thread_t odph_odpthread_t;
+typedef odph_thread_t ODPH_DEPRECATE(odph_odpthread_t);
/** @deprecated Legacy thread parameters */
-typedef odph_thread_param_t odph_odpthread_params_t;
+typedef odph_thread_param_t ODPH_DEPRECATE(odph_odpthread_params_t);
/** Common parameters for odph_thread_create() call */
typedef struct {
@@ -292,9 +294,10 @@ int odph_thread_join(odph_thread_t thread[], int num);
*
* @deprecated Use odph_thread_create() instead.
*/
-int odph_odpthreads_create(odph_odpthread_t *thread_tbl,
- const odp_cpumask_t *mask,
- const odph_odpthread_params_t *thr_params);
+int ODPH_DEPRECATE(odph_odpthreads_create)(
+ ODPH_DEPRECATE(odph_odpthread_t) *thread_tbl,
+ const odp_cpumask_t *mask,
+ const ODPH_DEPRECATE(odph_odpthread_params_t) *thr_params);
/**
* Waits odpthreads (as linux threads or processes) to exit.
@@ -308,7 +311,8 @@ int odph_odpthreads_create(odph_odpthread_t *thread_tbl,
*
* @deprecated Use odph_thread_join() instead.
*/
-int odph_odpthreads_join(odph_odpthread_t *thread_tbl);
+int ODPH_DEPRECATE(odph_odpthreads_join)(
+ ODPH_DEPRECATE(odph_odpthread_t) *thread_tbl);
/**
* Set CPU affinity of the current odp thread
diff --git a/helper/threads.c b/helper/threads.c
index 9326e12e6..221709a04 100644
--- a/helper/threads.c
+++ b/helper/threads.c
@@ -43,7 +43,7 @@ static void *run_thread(void *arg)
int status;
int ret;
odp_instance_t instance;
- odph_odpthread_params_t *thr_params;
+ ODPH_DEPRECATE(odph_odpthread_params_t) *thr_params;
odph_thread_start_args_t *start_args = arg;
@@ -395,9 +395,10 @@ int odph_thread_join(odph_thread_t thread[], int num)
/*
* create an odpthread set (as linux processes or linux threads or both)
*/
-int odph_odpthreads_create(odph_odpthread_t *thread_tbl,
- const odp_cpumask_t *mask,
- const odph_odpthread_params_t *thr_params)
+int ODPH_DEPRECATE(odph_odpthreads_create)(
+ ODPH_DEPRECATE(odph_odpthread_t) *thread_tbl,
+ const odp_cpumask_t *mask,
+ const ODPH_DEPRECATE(odph_odpthread_params_t) *thr_params)
{
int i;
int num;
@@ -406,7 +407,7 @@ int odph_odpthreads_create(odph_odpthread_t *thread_tbl,
num = odp_cpumask_count(mask);
- memset(thread_tbl, 0, num * sizeof(odph_odpthread_t));
+ memset(thread_tbl, 0, num * sizeof(*thread_tbl));
cpu_count = odp_cpu_count();
@@ -425,7 +426,7 @@ int odph_odpthreads_create(odph_odpthread_t *thread_tbl,
/* Copy thread parameters */
start_args->thr_params = *thr_params;
- start_args->instance = thr_params->instance;
+ start_args->instance = thr_params->ODPH_DEPRECATE(instance);
if (helper_options.mem_model == ODP_MEM_MODEL_THREAD) {
if (create_pthread(&thread_tbl[i], cpu, 0))
@@ -445,7 +446,8 @@ int odph_odpthreads_create(odph_odpthread_t *thread_tbl,
/*
* wait for the odpthreads termination (linux processes and threads)
*/
-int odph_odpthreads_join(odph_odpthread_t *thread_tbl)
+int ODPH_DEPRECATE(odph_odpthreads_join)(
+ ODPH_DEPRECATE(odph_odpthread_t) *thread_tbl)
{
pid_t pid;
int i = 0;