Skip to content

Commit

Permalink
sched: Disable the scheduling when send SIGCHLD signal
Browse files Browse the repository at this point in the history
Disable the scheduling to prevent other tasks from being
deleted after they are awakened

Signed-off-by: zhangyuan29 <[email protected]>
  • Loading branch information
zyfeier authored and xiaoxiang781216 committed Oct 2, 2024
1 parent b6d2dc6 commit dcae65f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions sched/task/task_exithook.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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!)
*/
Expand Down

0 comments on commit dcae65f

Please sign in to comment.