aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'os/kernel')
-rw-r--r--os/kernel/src/chschd.c13
1 files changed, 7 insertions, 6 deletions
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);
}
/**