From 8cf7b70436de8a93b2a0b3ddaeffbc7bfe4a5666 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 15 Mar 2010 16:04:47 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1743 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/kernel/src/chschd.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'os/kernel/src') diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c index 441559c36..412467b65 100644 --- a/os/kernel/src/chschd.c +++ b/os/kernel/src/chschd.c @@ -196,16 +196,17 @@ void chSchWakeupS(Thread *ntp, msg_t msg) { * to @p TRUE. */ void chSchDoRescheduleI(void) { + Thread *otp, *ntp; - Thread *otp = currp; - /* Pick the first thread from the ready queue and makes it current.*/ - (currp = fifo_remove(&rlist.r_queue))->p_state = THD_STATE_CURRENT; - chSchReadyI(otp); #if CH_TIME_QUANTUM > 0 rlist.r_preempt = CH_TIME_QUANTUM; #endif - chDbgTrace(currp, otp); - chSysSwitchI(currp, otp); + otp = currp; + /* Pick the first thread from the ready queue and makes it current.*/ + (currp = ntp = fifo_remove(&rlist.r_queue))->p_state = THD_STATE_CURRENT; + chSchReadyI(otp); + chDbgTrace(ntp, otp); + chSysSwitchI(ntp, otp); } /** -- cgit v1.2.3