You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by je...@apache.org on 2023/01/24 07:05:22 UTC

[nuttx] branch master updated: pthread: Implement pthread_gettid_np

This is an automated email from the ASF dual-hosted git repository.

jerpelea pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 55565a6099 pthread: Implement pthread_gettid_np
55565a6099 is described below

commit 55565a609926390fe52be55f54c24fa40a77a013
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Sun Jan 22 00:36:51 2023 +0800

    pthread: Implement pthread_gettid_np
    
    which is provided by bionic libc:
    https://android.googlesource.com/platform/bionic/+/master/libc/include/pthread.h#172
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 include/pthread.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/pthread.h b/include/pthread.h
index 05616a54c6..639badd12f 100644
--- a/include/pthread.h
+++ b/include/pthread.h
@@ -525,7 +525,8 @@ void pthread_yield(void);
 
 /* A thread may obtain a copy of its own thread handle. */
 
-#define pthread_self() ((pthread_t)gettid())
+#define pthread_self()            ((pthread_t)gettid())
+#define pthread_gettid_np(thread) ((pid_t)(thread))
 
 /* Compare two thread IDs. */