proc: change proc_yield() behaviour.
authorarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 16 Apr 2010 15:45:54 +0000 (15:45 +0000)
committerarighi <arighi@38d2e660-2303-0410-9eaa-f027e97ec537>
Fri, 16 Apr 2010 15:45:54 +0000 (15:45 +0000)
commit6f94c02fb352edc96748561f757c35c61bbd6ed1
tree78b55002f759df899f4f87d89acf69cc3c9fb25f
parent319029b456527124521b6a6a65c21edb321cdcb8
proc: change proc_yield() behaviour.

The current proc_yield() behaviour is to add the current process to the
ready list and call the scheduler. However, if a process is running at
the highest priority and calls proc_yield() it is added into the ready
list, but immediately re-executed by the scheduler starving all the
other processes.

The behaviour of proc_yield() has been changed so that it first picks
the next process from the ready list and then enqueue the current
running process into the ready list.

In this way the semantic of proc_yield() is exactly the same as
timer_delay(), or any other kind of delay that requires a context
switch.

git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3442 38d2e660-2303-0410-9eaa-f027e97ec537
bertos/kern/coop.c
bertos/kern/preempt.c