diff options
author | Petri Savolainen <petri.savolainen@nokia.com> | 2019-05-03 15:18:44 +0300 |
---|---|---|
committer | Petri Savolainen <petri.savolainen@nokia.com> | 2019-05-09 09:43:17 +0300 |
commit | a51eaeca2eac68d65ab89a1417b98d0225ebf86a (patch) | |
tree | 76b4cba15b8b7ea166895ea574028df56ba65f1e /helper/include | |
parent | 0e1e2f891bd6d68e71a8ca6475dea6a2217a95a4 (diff) |
helper: thread: implement new thread create and join
Implemented new thread create and join functions.
Signed-off-by: Petri Savolainen <petri.savolainen@nokia.com>
Reviewed-by: Matias Elo <matias.elo@nokia.com>
Reviewed-by: Stanislaw Kardach <skardach@marvell.com>
Diffstat (limited to 'helper/include')
-rw-r--r-- | helper/include/odp/helper/threads.h | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/helper/include/odp/helper/threads.h b/helper/include/odp/helper/threads.h index 5a2a21157..34f539f1a 100644 --- a/helper/include/odp/helper/threads.h +++ b/helper/include/odp/helper/threads.h @@ -1,4 +1,5 @@ /* Copyright (c) 2013-2018, Linaro Limited + * Copyright (c) 2019, Nokia * All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause @@ -70,17 +71,34 @@ typedef struct { } odph_thread_param_t; -/** The odpthread starting arguments, used both in process or thread mode */ +/** Helper internal thread start arguments. Used both in process and thread + * mode */ typedef struct { - odp_mem_model_t mem_model; /**< process or thread */ - odph_thread_param_t thr_params; /**< odpthread start parameters */ -} odph_odpthread_start_args_t; + /** Atomic variable to sync status */ + odp_atomic_u32_t status; -/** Linux odpthread state information, used both in process or thread mode */ + /** Process or thread */ + odp_mem_model_t mem_model; + + /** ODP instance handle */ + odp_instance_t instance; + + /** Thread parameters */ + odph_thread_param_t thr_params; + +} odph_thread_start_args_t; + +/** Thread state information. Used both in process and thread mode */ typedef struct { - odph_odpthread_start_args_t start_args; /**< start arguments */ - int cpu; /**< CPU ID */ - int last; /**< true if last table entry */ + /** Start arguments */ + odph_thread_start_args_t start_args; + + /** CPU ID */ + int cpu; + + /** 1: last table entry */ + uint8_t last; + /** Variant field mappings for thread/process modes */ union { /** For thread implementation */ @@ -88,12 +106,14 @@ typedef struct { pthread_t thread_id; /**< Pthread ID */ pthread_attr_t attr; /**< Pthread attributes */ } thread; + /** For process implementation */ struct { pid_t pid; /**< Process ID */ int status; /**< Process state chge status*/ } proc; }; + } odph_thread_t; /** Linux helper options */ |