diff --git a/sched/group/group_exitinfo.c b/sched/group/group_exitinfo.c index 22987a76b47a9..488b6840bc4cb 100644 --- a/sched/group/group_exitinfo.c +++ b/sched/group/group_exitinfo.c @@ -31,7 +31,6 @@ #include #include -#include #include #include "sched/sched.h" @@ -70,14 +69,14 @@ int group_exitinfo(pid_t pid, FAR struct binary_s *bininfo) irqstate_t flags; DEBUGASSERT(bininfo != NULL); - flags = spin_lock_irqsave(NULL); + flags = enter_critical_section(); /* Get the TCB associated with the PID */ tcb = nxsched_get_tcb(pid); if (tcb == NULL) { - spin_unlock_irqrestore(NULL, flags); + leave_critical_section(flags); return -ESRCH; } @@ -90,7 +89,7 @@ int group_exitinfo(pid_t pid, FAR struct binary_s *bininfo) group->tg_bininfo = bininfo; - spin_unlock_irqrestore(NULL, flags); + leave_critical_section(flags); return OK; }