This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch releases/12.11
in repository https://gitbox.apache.org/repos/asf/nuttx.git

commit a4c42e54f79f9429a35c57d40c4f980bd81af261
Author: Jukka Laitinen <[email protected]>
AuthorDate: Fri Aug 29 18:05:32 2025 +0300

    sched/signal/sig_dispatch.c: Correct signal dispatch to specific thread
    
    The signal dispatch is called from interrupt handlers as well, so
    this_task() is wrong. The thread to which the signal is supposed to
    be delivered is known (stcb), use that.
    
    Signed-off-by: Jukka Laitinen <[email protected]>
---
 sched/signal/sig_dispatch.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c
index b1cb1e9d4ef..59c98ee7c22 100644
--- a/sched/signal/sig_dispatch.c
+++ b/sched/signal/sig_dispatch.c
@@ -755,12 +755,12 @@ int nxsig_dispatch(pid_t pid, FAR siginfo_t *info, bool 
thread)
     {
       if (thread)
         {
-          /* Before the notification, we should validate the tid and
-           * and make sure that the notified thread is in same process
-           * with the current thread.
+          /* Before the notification, we should validate the tid. If the
+           * signal is to be delivered to a thread which has exited, it is
+           * just dropped.
            */
 
-          if (stcb != NULL && group == this_task()->group)
+          if (stcb != NULL)
             {
               return nxsig_tcbdispatch(stcb, info, false);
             }

Reply via email to