From: Petri Savolainen <petri.savolai...@linaro.org>

Use internally always the inlined version of thread id function.

Signed-off-by: Petri Savolainen <petri.savolai...@linaro.org>
---
/** Email created from pull request 433 (psavol:master-thread-inline)
 ** https://github.com/Linaro/odp/pull/433
 ** Patch: https://github.com/Linaro/odp/pull/433.patch
 ** Base sha: 6be7adab1a16a62e871bc4ed4f3c926645b2ecd0
 ** Merge commit sha: 81e939496b96b0bf1c85e197d4aa70c21870ecf7
 **/
 platform/linux-generic/odp_rwlock_recursive.c   | 11 ++++++-----
 platform/linux-generic/odp_spinlock_recursive.c |  7 ++++---
 2 files changed, 10 insertions(+), 8 deletions(-)

diff --git a/platform/linux-generic/odp_rwlock_recursive.c 
b/platform/linux-generic/odp_rwlock_recursive.c
index 1f93df35d..d484ba5ae 100644
--- a/platform/linux-generic/odp_rwlock_recursive.c
+++ b/platform/linux-generic/odp_rwlock_recursive.c
@@ -8,6 +8,7 @@
 
 #include <odp/api/rwlock_recursive.h>
 #include <odp/api/thread.h>
+#include <odp/api/plat/thread_inlines.h>
 #include <string.h>
 
 #define NO_OWNER (-1)
@@ -22,7 +23,7 @@ void odp_rwlock_recursive_init(odp_rwlock_recursive_t *rlock)
 /* Multiple readers can recurse the lock concurrently */
 void odp_rwlock_recursive_read_lock(odp_rwlock_recursive_t *rlock)
 {
-       int thr = odp_thread_id();
+       int thr = _odp_thread_id();
 
        if (rlock->rd_cnt[thr]) {
                rlock->rd_cnt[thr]++;
@@ -36,7 +37,7 @@ void odp_rwlock_recursive_read_lock(odp_rwlock_recursive_t 
*rlock)
 /* Multiple readers can recurse the lock concurrently */
 int odp_rwlock_recursive_read_trylock(odp_rwlock_recursive_t *rlock)
 {
-       int thr = odp_thread_id();
+       int thr = _odp_thread_id();
 
        if (rlock->rd_cnt[thr]) {
                rlock->rd_cnt[thr]++;
@@ -53,7 +54,7 @@ int odp_rwlock_recursive_read_trylock(odp_rwlock_recursive_t 
*rlock)
 
 void odp_rwlock_recursive_read_unlock(odp_rwlock_recursive_t *rlock)
 {
-       int thr = odp_thread_id();
+       int thr = _odp_thread_id();
 
        rlock->rd_cnt[thr]--;
 
@@ -66,7 +67,7 @@ void odp_rwlock_recursive_read_unlock(odp_rwlock_recursive_t 
*rlock)
 /* Only one writer can recurse the lock */
 void odp_rwlock_recursive_write_lock(odp_rwlock_recursive_t *rlock)
 {
-       int thr = odp_thread_id();
+       int thr = _odp_thread_id();
 
        if (rlock->wr_owner == thr) {
                rlock->wr_cnt++;
@@ -81,7 +82,7 @@ void odp_rwlock_recursive_write_lock(odp_rwlock_recursive_t 
*rlock)
 /* Only one writer can recurse the lock */
 int odp_rwlock_recursive_write_trylock(odp_rwlock_recursive_t *rlock)
 {
-       int thr = odp_thread_id();
+       int thr = _odp_thread_id();
 
        if (rlock->wr_owner == thr) {
                rlock->wr_cnt++;
diff --git a/platform/linux-generic/odp_spinlock_recursive.c 
b/platform/linux-generic/odp_spinlock_recursive.c
index 5293c04b1..d6d914201 100644
--- a/platform/linux-generic/odp_spinlock_recursive.c
+++ b/platform/linux-generic/odp_spinlock_recursive.c
@@ -8,6 +8,7 @@
 
 #include <odp/api/spinlock_recursive.h>
 #include <odp/api/thread.h>
+#include <odp/api/plat/thread_inlines.h>
 
 #define NO_OWNER (-1)
 
@@ -20,7 +21,7 @@ void odp_spinlock_recursive_init(odp_spinlock_recursive_t 
*rlock)
 
 void odp_spinlock_recursive_lock(odp_spinlock_recursive_t *rlock)
 {
-       int thr = odp_thread_id();
+       int thr = _odp_thread_id();
 
        if (rlock->owner == thr) {
                rlock->cnt++;
@@ -34,7 +35,7 @@ void odp_spinlock_recursive_lock(odp_spinlock_recursive_t 
*rlock)
 
 int odp_spinlock_recursive_trylock(odp_spinlock_recursive_t *rlock)
 {
-       int thr = odp_thread_id();
+       int thr = _odp_thread_id();
 
        if (rlock->owner == thr) {
                rlock->cnt++;
@@ -63,7 +64,7 @@ void odp_spinlock_recursive_unlock(odp_spinlock_recursive_t 
*rlock)
 
 int odp_spinlock_recursive_is_locked(odp_spinlock_recursive_t *rlock)
 {
-       int thr = odp_thread_id();
+       int thr = _odp_thread_id();
 
        if (rlock->owner == thr)
                return 1;

Reply via email to