From e981a5c8bc757fef62c4db7cf41e824cb68bb20c Mon Sep 17 00:00:00 2001 From: Masayuki Ishikawa Date: Mon, 25 Jan 2021 14:28:52 +0900 Subject: [PATCH] sched: task: Fix comments and label in nxtask_assign_pid() Summary: - This commit fixes comments and label in nxtask_assign_pid() Impact: - None Testing: - Built with spresense:wifi Signed-off-by: Masayuki Ishikawa --- sched/task/task_setup.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sched/task/task_setup.c b/sched/task/task_setup.c index 87e9124528b..82e93a02898 100644 --- a/sched/task/task_setup.c +++ b/sched/task/task_setup.c @@ -83,6 +83,11 @@ static int nxtask_assign_pid(FAR struct tcb_s *tcb) int tries; int ret = ERROR; + /* NOTE: + * ERROR means that the g_pidhash[] table is completely full. + * We cannot allow another task to be started. + */ + /* Protect the following operation with a critical section * because g_pidhash is accessed from an interrupt context */ @@ -123,14 +128,11 @@ static int nxtask_assign_pid(FAR struct tcb_s *tcb) tcb->pid = next_pid; ret = OK; - goto errout; + goto out; } } -errout: - /* If we get here, then the g_pidhash[] table is completely full. - * We cannot allow another task to be started. - */ +out: leave_critical_section(flags); return ret;