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-09-13 19:15:36 +08:00 committed by Mateusz Szafoni
parent b52ad53cc1
commit cdb5a7c6d4

View File

@ -448,6 +448,12 @@ void nxtask_exithook(FAR struct tcb_s *tcb, int status)
irqstate_t flags = enter_critical_section(); irqstate_t flags = enter_critical_section();
#endif #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 */ /* Send the SIGCHLD signal to the parent task group */
nxtask_signalparent(tcb, status); nxtask_signalparent(tcb, status);
@ -456,6 +462,8 @@ void nxtask_exithook(FAR struct tcb_s *tcb, int status)
nxtask_exitwakeup(tcb, status); nxtask_exitwakeup(tcb, status);
sched_unlock();
/* Leave the task group. Perhaps discarding any un-reaped child /* Leave the task group. Perhaps discarding any un-reaped child
* status (no zombies here!) * status (no zombies here!)
*/ */