mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user