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 2021/05/17 12:14:44 UTC

[incubator-nuttx] branch master updated: group/group_signal: cancel dispatch signal when

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/incubator-nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 5ec3ef0  group/group_signal: cancel dispatch signal when
5ec3ef0 is described below

commit 5ec3ef0e56c8a8ca4b3f4b5991128cf3b96413c5
Author: Jiuzhu Dong <do...@xiaomi.com>
AuthorDate: Wed May 12 15:27:03 2021 +0800

    group/group_signal: cancel dispatch signal when
    
    the number of members in the group is zero.
    
    Repetition step:
    If using waitpid() to wait a task has exited, the waitpid will use
    nxsing_kill with signal number 0 to determine if that task is still
    alive, and will call group_signal to dispatch signal for each member
    of the group and perform signal handing checks, it will assert at
    sched/group/group_signal.c:261.
    
    Change-Id: I75ef015a261101277436d742897ce68fed44b5da
    Signed-off-by: Jiuzhu Dong <do...@xiaomi.com>
---
 sched/group/group_signal.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sched/group/group_signal.c b/sched/group/group_signal.c
index 85796f6..fdb26e3 100644
--- a/sched/group/group_signal.c
+++ b/sched/group/group_signal.c
@@ -245,11 +245,15 @@ int group_signal(FAR struct task_group_s *group, FAR siginfo_t *siginfo)
        * signal to a pending state.
        */
 
-      else /* if (info.dtcb) */
+      else if (info.dtcb)
         {
-          DEBUGASSERT(info.dtcb);
           tcb = info.dtcb;
         }
+      else
+        {
+          ret = -ECHILD;
+          goto errout;
+        }
 
       /* Now deliver the signal to the selected group member */