sched/group/group_killchildren.c: Force-cancel children if parent is force-cancelled

There is no point in waiting for children to exit if the parent is force-cancelled

Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
Jukka Laitinen 2024-03-19 12:06:34 +02:00 committed by Alan Carvalho de Assis
parent 401b3e682c
commit 7c6b6171f5

View File

@ -181,6 +181,9 @@ int group_kill_children(FAR struct tcb_s *tcb)
#if defined(CONFIG_GROUP_KILL_CHILDREN_TIMEOUT_MS) && \ #if defined(CONFIG_GROUP_KILL_CHILDREN_TIMEOUT_MS) && \
CONFIG_GROUP_KILL_CHILDREN_TIMEOUT_MS != 0 CONFIG_GROUP_KILL_CHILDREN_TIMEOUT_MS != 0
if ((tcb->flags & TCB_FLAG_FORCED_CANCEL) == 0)
{
/* Send SIGTERM for each first */ /* Send SIGTERM for each first */
group_foreachchild(tcb->group, group_kill_children_handler, group_foreachchild(tcb->group, group_kill_children_handler,
@ -206,6 +209,7 @@ int group_kill_children(FAR struct tcb_s *tcb)
} }
# endif # endif
} }
}
#endif #endif
/* Force cancel/delete again */ /* Force cancel/delete again */