sched/task/task_getpid: getpid should return process id not thread id

Summary:
   implement the right semantics:
1. getpid should return the main thread id
2. gettid should return the current thread id

Refer to:
 https://github.com/apache/incubator-nuttx/issues/2499
 https://github.com/apache/incubator-nuttx/pull/2518

Signed-off-by: qinwei1 <qinwei1@xiaomi.com>
This commit is contained in:
qinwei1
2022-11-15 14:37:20 +08:00
committed by Xiang Xiao
parent 5a367ad59d
commit 8021dfece6
28 changed files with 56 additions and 76 deletions
+2 -2
View File
@@ -66,7 +66,7 @@ static inline void nxtask_exitstatus(FAR struct task_group_s *group,
{
/* No.. Find the exit status entry for this task in the parent TCB */
child = group_find_child(group, getpid());
child = group_find_child(group, gettid());
if (child)
{
/* Save the exit status.. For the case of HAVE_GROUP_MEMBERS,
@@ -105,7 +105,7 @@ static inline void nxtask_groupexit(FAR struct task_group_s *group)
{
/* No.. Find the exit status entry for this task in the parent TCB */
child = group_find_child(group, getpid());
child = group_find_child(group, gettid());
if (child)
{
/* Mark that all members of the child task group has exited */