unified: Eliminate useless check in idle thread

There is no reason to check if the idle thread is a cooperative thread
before invoking k_yield(); it is safe to unconditionally invoke it every
iteration.

Rationale: If the idle thread is cooperative, k_yield() must be invoked
to allow a new thread to get scheduled to run. If the idle thread is
preemptive, then k_yield() effectively becomes a no-op.

Change-Id: Ide3204c92381640b5d12b39ca0f258d56d8cc3d0
Signed-off-by: Peter Mitsis <peter.mitsis@windriver.com>
This commit is contained in:
Peter Mitsis 2016-09-14 15:40:01 -04:00 committed by Benjamin Walsh
parent ba26615a47
commit 19547d09f7

View file

@ -199,9 +199,7 @@ static void idle(void *unused1, void *unused2, void *unused3)
for (;;) {
nano_cpu_idle();
if (_is_coop(_current)) {
k_yield();
}
k_yield();
}
}