arch: _exit should't call nxsched_resume_scheduler twice in SMP mode

utilize the call inside nxtask_exit instead, also move
nxsched_suspend_scheduler to nxtask_exit for symmetry

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: I219fc15faf0026e452b0db3906aa40b40ac677f3
This commit is contained in:
Xiang Xiao
2020-06-04 13:59:09 +08:00
committed by Abdelatif Guettouche
parent c45289eb89
commit 85b859fb8d
16 changed files with 7 additions and 118 deletions

View File

@@ -84,6 +84,10 @@ int nxtask_exit(void)
dtcb = this_task();
#endif
/* Update scheduler parameters */
nxsched_suspend_scheduler(dtcb);
/* Remove the TCB of the current task from the ready-to-run list. A
* context switch will definitely be necessary -- that must be done
* by the architecture-specific logic.
@@ -102,13 +106,11 @@ int nxtask_exit(void)
rtcb = this_task();
#endif
#ifdef CONFIG_SMP
/* Because clearing the global IRQ control in nxsched_remove_readytorun()
* was moved to nxsched_resume_scheduler(). So call the API here.
*/
nxsched_resume_scheduler(rtcb);
#endif
/* We are now in a bad state -- the head of the ready to run task list
* does not correspond to the thread that is running. Disabling pre-