kernel/sched: Change ordering of round-robin time slice check and processing of wdog timers
kernel/sched: Change ordering of round-robin time slice check and processing of wdog timers

wd_timer()'s callback function can change current running task and hence it must be called after the time slice check.

The time slice check will decrement the currently running task's time slice count.
When context switch occurs before decrementing the slice count, then the newly started task will lost one slice count before it even has a chance to run.

This is patch is back ported from Nuttx.

Signed-off-by: Lokesh B V <a10c1c2561c872cd1fd5899c4340d5ec87a91507@partner.samsung.com>

sunghan-chang/TizenRT,jeongarmy/TizenRT,an4967/TizenRT,lokeshbv/TizenRT,chanijjani/TizenRT,junmin-kim/TizenRT,chanijjani/TizenRT,jsdosa/TizenRT,lokeshbv/TizenRT,pillip8282/TizenRT,pillip8282/TizenRT,Samsung/TizenRT,JeonginKim/TizenRT,jeongchanKim/TizenRT,btheosam/TizenRT,an4967/TizenRT,btheosam/TizenRT,HONGCHAEHEE/TizenRT,pillip8282/TizenRT,jeongarmy/TizenRT,an4967/TizenRT,davidfather/TizenRT,junmin-kim/TizenRT,btheosam/TizenRT,JeonginKim/TizenRT,jeongchanKim/TizenRT,junmin-kim/TizenRT,jsdosa/TizenRT,jeongarmy/TizenRT,lokeshbv/TizenRT,jeongchanKim/TizenRT,sunghan-chang/TizenRT,HONGCHAEHEE/TizenRT,pillip8282/TizenRT,jeongchanKim/TizenRT,lokeshbv/TizenRT,btheosam/TizenRT,junmin-kim/TizenRT,btheosam/TizenRT,junmin-kim/TizenRT,davidfather/TizenRT,an4967/TizenRT,jsdosa/TizenRT,jeongarmy/TizenRT,HONGCHAEHEE/TizenRT,jsdosa/TizenRT,Samsung/TizenRT,sunghan-chang/TizenRT,davidfather/TizenRT,jsdosa/TizenRT,JeonginKim/TizenRT,davidfather/TizenRT,chanijjani/TizenRT,junmin-kim/TizenRT,HONGCHAEHEE/TizenRT,lokeshbv/TizenRT,sunghan-chang/TizenRT,chanijjani/TizenRT,jsdosa/TizenRT,sunghan-chang/TizenRT,Samsung/TizenRT,Samsung/TizenRT,an4967/TizenRT,btheosam/TizenRT,an4967/TizenRT,davidfather/TizenRT,JeonginKim/TizenRT,pillip8282/TizenRT,jeongarmy/TizenRT,chanijjani/TizenRT,sunghan-chang/TizenRT,pillip8282/TizenRT,jeongarmy/TizenRT,chanijjani/TizenRT,an4967/TizenRT,lokeshbv/TizenRT,Samsung/TizenRT,davidfather/TizenRT,jeongchanKim/TizenRT,sunghan-chang/TizenRT,chanijjani/TizenRT,HONGCHAEHEE/TizenRT,jsdosa/TizenRT,pillip8282/TizenRT,JeonginKim/TizenRT,Samsung/TizenRT,jeongchanKim/TizenRT,JeonginKim/TizenRT,junmin-kim/TizenRT,davidfather/TizenRT,Samsung/TizenRT,HONGCHAEHEE/TizenRT,jeongchanKim/TizenRT,jeongarmy/TizenRT