diff --git a/sched/pthread/pthread_cancel.c b/sched/pthread/pthread_cancel.c index 20e6f838b73..4914457c863 100644 --- a/sched/pthread/pthread_cancel.c +++ b/sched/pthread/pthread_cancel.c @@ -60,8 +60,8 @@ int pthread_cancel(pthread_t thread) if (thread == 0) { - /* pid == 0 is the IDLE task. Callers cannot cancel the - * IDLE task. + /* pid == 0 is the IDLE task (in a single CPU configuration). Callers + * cannot cancel the IDLE task. */ return ESRCH; diff --git a/sched/sched/sched_idletask.c b/sched/sched/sched_idletask.c index 9885aca1a7d..f8c0b3768d6 100644 --- a/sched/sched/sched_idletask.c +++ b/sched/sched/sched_idletask.c @@ -84,6 +84,10 @@ bool sched_idletask(void) * (1) It always lies at the end of the task list, * (2) It always has priority zero, and * (3) It should have the TCB_FLAG_CPU_LOCKED flag set. + * + * In the non-SMP case, the IDLE task will also have PID=0, but that + * is not a portable test because there are multiple IDLE tasks with + * different PIDs in the SMP configuration. */ return (rtcb->flink == NULL);