The TCB nchildren field should not be incremented when pthreads are created.
This commit is contained in:
parent
1447effd7d
commit
858af4295c
@ -239,6 +239,8 @@ int waitid(idtype_t idtype, id_t id, FAR siginfo_t *info, int options)
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* Child status is not retained. */
|
||||
|
||||
if (rtcb->nchildren == 0)
|
||||
{
|
||||
/* There are no children */
|
||||
|
@ -383,6 +383,7 @@ pid_t waitpid(pid_t pid, int *stat_loc, int options)
|
||||
/* Get the TCB corresponding to this PID and make sure it is our child. */
|
||||
|
||||
ctcb = sched_gettcb(pid);
|
||||
|
||||
#ifdef HAVE_GROUP_MEMBERS
|
||||
if (!ctcb || ctcb->group->tg_pgid != rtcb->group->tg_gid)
|
||||
#else
|
||||
|
@ -190,6 +190,7 @@ int task_reparent(pid_t ppid, pid_t chpid)
|
||||
}
|
||||
|
||||
#else /* CONFIG_SCHED_CHILD_STATUS */
|
||||
/* Child task exit status is not retained */
|
||||
|
||||
DEBUGASSERT(otcb->nchildren > 0);
|
||||
|
||||
@ -302,6 +303,7 @@ int task_reparent(pid_t ppid, pid_t chpid)
|
||||
}
|
||||
|
||||
#else /* CONFIG_SCHED_CHILD_STATUS */
|
||||
/* Child task exit status is not retained */
|
||||
|
||||
DEBUGASSERT(otcb->nchildren > 0);
|
||||
|
||||
|
@ -275,8 +275,17 @@ static inline void task_saveparent(FAR struct tcb_s *tcb, uint8_t ttype)
|
||||
}
|
||||
}
|
||||
#else
|
||||
DEBUGASSERT(rtcb->nchildren < UINT16_MAX);
|
||||
rtcb->nchildren++;
|
||||
/* Child status is not retained. Simply keep track of the number
|
||||
* child tasks (not pthreads) created.
|
||||
*/
|
||||
|
||||
#ifndef CONFIG_DISABLE_PTHREAD
|
||||
if ((tcb->flags & TCB_FLAG_TTYPE_MASK) != TCB_FLAG_TTYPE_PTHREAD)
|
||||
#endif
|
||||
{
|
||||
DEBUGASSERT(rtcb->nchildren < UINT16_MAX);
|
||||
rtcb->nchildren++;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
#else
|
||||
|
Loading…
Reference in New Issue
Block a user