From 1d04ef2f93ff72317c5620baa2fe735c9c520d55 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 29 Aug 2018 14:55:45 -0600 Subject: [PATCH] sched/signal/sig_default.c: Lock the scheduler while while killing the children so that we do not lose priority and let the task group continue to run in an indeterminate state. --- sched/signal/sig_default.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sched/signal/sig_default.c b/sched/signal/sig_default.c index c13ed89f2b7..8b8c3fdf81b 100644 --- a/sched/signal/sig_default.c +++ b/sched/signal/sig_default.c @@ -169,9 +169,14 @@ static void nxsig_abnormal_termination(int signo) * this will not kill the currently running task/pthread (this_task). It * will kill the main thread of the task group if the this_task is a * pthread. + * + * Lock the scheduler so that there this thread will not lose priority + * until all of its children are dead. */ + sched_lock(); group_killchildren((FAR struct task_tcb_s *)rtcb); + sched_unlock(); #endif #ifndef CONFIG_DISABLE_PTHREAD