nuttx/sched: use pid to check idle task

Pid is more appropriate than the flink pointer to determine idle task,
when we want to use other data structure to optimize the task list.
This commit is contained in:
zhangyuan21
2022-10-28 14:22:17 +08:00
committed by Masayuki Ishikawa
parent b353d84742
commit 18266c1012
14 changed files with 17 additions and 15 deletions
+2 -2
View File
@@ -319,7 +319,7 @@ void sched_note_resume(FAR struct tcb_s *tcb)
if (!up_interrupt_context())
{
if (tcb->flink == NULL)
if (is_idle_task(tcb))
{
SEGGER_SYSVIEW_OnIdle();
}
@@ -354,7 +354,7 @@ void sched_note_irqhandler(int irq, FAR void *handler, bool enter)
{
FAR struct tcb_s *tcb = this_task();
if (tcb && tcb->flink != NULL)
if (tcb && !is_idle_task(tcb))
{
SEGGER_SYSVIEW_OnTaskStartExec(tcb->pid);
}