You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/03/07 14:53:28 UTC
(nuttx) 02/02: sched/group: skip child wait if here is only self in member list
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
commit beb2af83783e8f6136f45c9abb3c17f3f9ddce66
Author: chao an <an...@lixiang.com>
AuthorDate: Thu Mar 7 18:59:56 2024 +0800
sched/group: skip child wait if here is only self in member list
Skip the child wait if here is only self in member list,
since the members of the task group should be 1 if task exit.
Fix Regression issue that the task could not terminate normally.
Signed-off-by: chao an <an...@lixiang.com>
---
sched/group/group_killchildren.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/sched/group/group_killchildren.c b/sched/group/group_killchildren.c
index 7807af43ec..514673ee97 100644
--- a/sched/group/group_killchildren.c
+++ b/sched/group/group_killchildren.c
@@ -191,7 +191,8 @@ int group_kill_children(FAR struct tcb_s *tcb)
ret = CONFIG_GROUP_KILL_CHILDREN_TIMEOUT_MS;
while (1)
{
- if (sq_empty(&tcb->group->tg_members))
+ if (sq_empty(&tcb->group->tg_members) ||
+ sq_is_singular(&tcb->group->tg_members))
{
break;
}