diff mbox

[v2,4/4] api: thread: Added odp_thread_count

Message ID 1422961167-2307-4-git-send-email-petri.savolainen@linaro.org
State New
Headers show

Commit Message

Petri Savolainen Feb. 3, 2015, 10:59 a.m. UTC
Improved thread id documentation and added odp_thread_count(),
which returns number of active threads.

Didn't add implementation yet

Signed-off-by: Petri Savolainen <petri.savolainen@linaro.org>
---
 include/odp/api/thread.h | 20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/include/odp/api/thread.h b/include/odp/api/thread.h
index 97d5de7..f6cd09d 100644
--- a/include/odp/api/thread.h
+++ b/include/odp/api/thread.h
@@ -23,13 +23,29 @@  extern "C" {
  */
 
 /**
- * Get thread id
+ * Thread id
  *
- * @return Thread id of the current thread
+ * Returns the thread id 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 id
  */
 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);
+
+/**
  * @}
  */