SMP: Fix returning uninitialized variable in nxsched_add_readytorun()

Prior to this commit, doswitch is returned uninitialized if
(task_state == TSTATE_TASK_ASSIGNED || task_state == TSTATE_TASK_RUNNING)
&& no context switch occurs
&& (cpu == me).

Signed-off-by: Mingjie Shen <shen497@purdue.edu>
This commit is contained in:
Mingjie Shen 2024-04-01 20:36:37 -04:00 committed by Masayuki Ishikawa
parent 1bc50b53bb
commit c40421c05b

View File

@ -366,6 +366,7 @@ bool nxsched_add_readytorun(FAR struct tcb_s *btcb)
btcb->cpu = cpu;
btcb->task_state = TSTATE_TASK_ASSIGNED;
doswitch = false;
}
/* All done, restart the other CPU (if it was paused). */