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 <jukka.laitinen@tii.ae>
This commit is contained in:
Jukka Laitinen 2025-08-29 18:05:32 +03:00 committed by Xiang Xiao
parent 628c05acf3
commit a4c42e54f7

View file

@ -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);
}