From 307d87bdecde7d3fbd3af085314777e089bd7621 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sun, 27 Mar 2016 14:30:20 +0000 Subject: Optimization in chSchWakeupS(). git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9172 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/rt/src/chschd.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'os/rt/src') diff --git a/os/rt/src/chschd.c b/os/rt/src/chschd.c index 3d7d04b58..ace722d7b 100644 --- a/os/rt/src/chschd.c +++ b/os/rt/src/chschd.c @@ -406,6 +406,7 @@ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) { * @sclass */ void chSchWakeupS(thread_t *ntp, msg_t msg) { + thread_t *otp = currp; chDbgCheckClassS(); @@ -421,12 +422,12 @@ void chSchWakeupS(thread_t *ntp, msg_t msg) { one then it is just inserted in the ready list else it made running immediately and the invoking thread goes in the ready list instead.*/ - if (ntp->prio <= currp->prio) { + if (ntp->prio <= otp->prio) { (void) chSchReadyI(ntp); } else { - thread_t *otp = chSchReadyI(currp); currp = ntp; + otp = chSchReadyI(otp); if (otp->prio == IDLEPRIO) { CH_CFG_IDLE_LEAVE_HOOK(); } -- cgit v1.2.3