mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
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:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user