aboutsummaryrefslogtreecommitdiffstats
path: root/src/chschd.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-07-30 11:01:56 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2008-07-30 11:01:56 +0000
commite150283e1f071673e1d3490cbf85651e5502d421 (patch)
treea34e5264e7c789b87ef2414472bbe8eb4a93d332 /src/chschd.c
parent0cd87f700cbc1d8dcb03bafe90793626d6efbb32 (diff)
downloadChibiOS-e150283e1f071673e1d3490cbf85651e5502d421.tar.gz
ChibiOS-e150283e1f071673e1d3490cbf85651e5502d421.tar.bz2
ChibiOS-e150283e1f071673e1d3490cbf85651e5502d421.zip
Various optimizations to the scheduler.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@378 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chschd.c')
-rw-r--r--src/chschd.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/chschd.c b/src/chschd.c
index c97eea1e8..8b606cd1b 100644
--- a/src/chschd.c
+++ b/src/chschd.c
@@ -174,18 +174,17 @@ void chSchWakeupS(Thread *ntp, msg_t msg) {
* Intended to be called if \p chSchRescRequired() evaluates to \p TRUE.
*/
void chSchDoRescheduleI(void) {
- /* put the running thread on the ready queue */
+
Thread *otp = currp;
- chSchReadyI(otp);
- /* pick the first thread from the ready queue */
+ /* pick the first thread from the ready queue and makes it current */
(currp = fifo_remove(&rlist.r_queue))->p_state = PRCURR;
+ chSchReadyI(otp);
#ifdef CH_USE_ROUNDROBIN
rlist.r_preempt = CH_TIME_QUANTUM;
#endif
#ifdef CH_USE_TRACE
chDbgTrace(otp, currp);
#endif
- /* switch thread context */
chSysSwitchI(otp, currp);
}