From 0c1f63625a08044f1cc0aabc372896e1a12bb1aa Mon Sep 17 00:00:00 2001 From: ligd Date: Tue, 25 Jan 2022 12:14:12 +0800 Subject: [PATCH] signal: Don't do schedule_sigaction when there is no action Signed-off-by: ligd --- sched/signal/sig_dispatch.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sched/signal/sig_dispatch.c b/sched/signal/sig_dispatch.c index 1b5edb3ee3..7553c5d633 100644 --- a/sched/signal/sig_dispatch.c +++ b/sched/signal/sig_dispatch.c @@ -105,6 +105,13 @@ static int nxsig_queue_action(FAR struct tcb_s *stcb, siginfo_t *info) flags = enter_critical_section(); sq_addlast((FAR sq_entry_t *)sigq, &(stcb->sigpendactionq)); + + /* Then schedule execution of the signal handling action on the + * recipient's thread. SMP related handling will be done in + * up_schedule_sigaction() + */ + + up_schedule_sigaction(stcb, nxsig_deliver); leave_critical_section(flags); } } @@ -383,13 +390,6 @@ int nxsig_tcbdispatch(FAR struct tcb_s *stcb, siginfo_t *info) flags = enter_critical_section(); - /* Then schedule execution of the signal handling action on the - * recipient's thread. SMP related handling will be done in - * up_schedule_sigaction() - */ - - up_schedule_sigaction(stcb, nxsig_deliver); - /* Check if the task is waiting for an unmasked signal. If so, then * unblock it. This must be performed in a critical section because * signals can be queued from the interrupt level.