diff --git a/sched/group/group_killchildren.c b/sched/group/group_killchildren.c index ec80c22e518..06c300e91e4 100644 --- a/sched/group/group_killchildren.c +++ b/sched/group/group_killchildren.c @@ -32,6 +32,7 @@ #include #include +#include #include "sched/sched.h" #include "group/group.h" @@ -201,9 +202,11 @@ int group_kill_children(FAR struct tcb_s *tcb) while (1) { if (tcb->group->tg_nmembers <= 1) + { break; + } - usleep(USEC_PER_MSEC); + nxsig_usleep(USEC_PER_MSEC); # if CONFIG_GROUP_KILL_CHILDREN_TIMEOUT_MS > 0 if (--ret < 0)