sched: Disable the scheduling when send SIGCHLD signal

Disable the scheduling to prevent other tasks from being
deleted after they are awakened

Signed-off-by: zhangyuan29 <zhangyuan29@xiaomi.com>
This commit is contained in:
zhangyuan29
2024-10-02 20:59:01 +08:00
committed by Xiang Xiao
parent b6d2dc6c54
commit dcae65f504
+8
View File
@@ -448,6 +448,12 @@ void nxtask_exithook(FAR struct tcb_s *tcb, int status)
irqstate_t flags = enter_critical_section();
#endif
/* Disable the scheduling function to prevent other tasks from
* being deleted after they are awakened
*/
sched_lock();
/* Send the SIGCHLD signal to the parent task group */
nxtask_signalparent(tcb, status);
@@ -456,6 +462,8 @@ void nxtask_exithook(FAR struct tcb_s *tcb, int status)
nxtask_exitwakeup(tcb, status);
sched_unlock();
/* Leave the task group. Perhaps discarding any un-reaped child
* status (no zombies here!)
*/