mirror of
https://github.com/apache/nuttx.git
synced 2026-09-26 18:16:27 +08:00
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:
@@ -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!)
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user