mirror of
https://github.com/apache/nuttx.git
synced 2026-05-31 23:40:19 +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)
|
if (thread)
|
||||||
{
|
{
|
||||||
/* Before the notification, we should validate the tid and
|
/* Before the notification, we should validate the tid. If the
|
||||||
* and make sure that the notified thread is in same process
|
* signal is to be delivered to a thread which has exited, it is
|
||||||
* with the current thread.
|
* just dropped.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (stcb != NULL && group == this_task()->group)
|
if (stcb != NULL)
|
||||||
{
|
{
|
||||||
return nxsig_tcbdispatch(stcb, info, false);
|
return nxsig_tcbdispatch(stcb, info, false);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user