diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-27 14:30:20 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2016-03-27 14:30:20 +0000 |
commit | 307d87bdecde7d3fbd3af085314777e089bd7621 (patch) | |
tree | e72a00c11d688f3c529db0335678414b4e870784 /os/rt/src | |
parent | 3d82d232b7cddd9a7baacdf42cf56e267aae907b (diff) | |
download | ChibiOS-307d87bdecde7d3fbd3af085314777e089bd7621.tar.gz ChibiOS-307d87bdecde7d3fbd3af085314777e089bd7621.tar.bz2 ChibiOS-307d87bdecde7d3fbd3af085314777e089bd7621.zip |
Optimization in chSchWakeupS().
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9172 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/rt/src')
-rw-r--r-- | os/rt/src/chschd.c | 5 |
1 files changed, 3 insertions, 2 deletions
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();
}
|