diff options
author | Petri Savolainen <petri.savolainen@linaro.org> | 2015-02-05 11:57:14 +0200 |
---|---|---|
committer | Maxim Uvarov <maxim.uvarov@linaro.org> | 2015-02-11 07:13:22 +0300 |
commit | 4c89f3a905f8b03ab6e4fce71ad9d5556a8a9f2c (patch) | |
tree | c867f0cc902a14dcea4e8cc17e10334e78e4cc07 /include/odp/api/thread.h | |
parent | e14083fb4e88bcbf9af4d4e59e2e3844d8bf5bb6 (diff) |
api: thread: Added odp_thread_count
Improved thread id documentation and added odp_thread_count(),
which returns number of active threads.
Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
Reviewed-by: Bill Fischofer <bill.fischofer@linaro.org>
Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'include/odp/api/thread.h')
-rw-r--r-- | include/odp/api/thread.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h index 4eb69cb83..a509ef907 100644 --- a/include/odp/api/thread.h +++ b/include/odp/api/thread.h @@ -25,11 +25,28 @@ extern "C" { /** * Get thread identifier * + * Returns the thread identifier of the current thread. Thread ids range from 0 + * to ODP_CONFIG_MAX_THREADS-1. The ODP thread id is assinged by + * odp_init_local() and freed by odp_term_local(). Thread id is unique within + * the ODP instance. + * * @return Thread identifier of the current thread */ 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_CONFIG_MAX_THREADS. + * + * @return Current thread count + */ +int odp_thread_count(void); + +/** * @} */ |