diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-14 16:32:41 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-14 16:32:41 +0000 |
commit | 890c5532da783e8d58cfbf28822bcedaa8a0c61d (patch) | |
tree | 617e200bc65fe60a4770f5dac26d1a42cccea48c /src/chschd.c | |
parent | e776216d02920673266e31d553078f4edec4a264 (diff) | |
download | ChibiOS-890c5532da783e8d58cfbf28822bcedaa8a0c61d.tar.gz ChibiOS-890c5532da783e8d58cfbf28822bcedaa8a0c61d.tar.bz2 ChibiOS-890c5532da783e8d58cfbf28822bcedaa8a0c61d.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@90 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chschd.c')
-rw-r--r-- | src/chschd.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/src/chschd.c b/src/chschd.c index c88a63ead..a3763cd38 100644 --- a/src/chschd.c +++ b/src/chschd.c @@ -81,7 +81,11 @@ Thread *chSchReadyI(Thread *tp) { * Switches to the next thread in the ready list, the ready list is assumed
* to contain at least a thread.
*/
+#ifdef CH_OPTIMIZE_SPEED
+static INLINE void nextready(void) {
+#else
static void nextready(void) {
+#endif
Thread *otp = currp;
(currp = fifo_remove(&rlist.r_queue))->p_state = PRCURR;
@@ -111,27 +115,27 @@ void chSchGoSleepS(t_tstate newstate) { * Wakeups a thread, the thread is inserted into the ready list or made
* running directly depending on its relative priority compared to the current
* thread.
- * @param tp the Thread to be made ready
+ * @param ntp the Thread to be made ready
* @param msg wakeup message to the awakened thread
* @note The function must be called in the system mutex zone.
* @note The function is not meant to be used in the user code directly.
* @note It is equivalent to a \p chSchReadyI() followed by a
* \p chSchRescheduleI() but much more efficient.
*/
-void chSchWakeupS(Thread *tp, t_msg msg) {
- Thread *ctp = currp;
+void chSchWakeupS(Thread *ntp, t_msg msg) {
- if (tp->p_prio <= ctp->p_prio)
- chSchReadyI(tp)->p_rdymsg = msg;
+ if (ntp->p_prio <= currp->p_prio)
+ chSchReadyI(ntp)->p_rdymsg = msg;
else {
- chSchReadyI(ctp);
- (currp = tp)->p_state = PRCURR;
- tp->p_rdymsg = msg;
+ Thread *otp = currp;
+ chSchReadyI(otp);
+ (currp = ntp)->p_state = PRCURR;
+ ntp->p_rdymsg = msg;
preempt = CH_TIME_QUANTUM;
#ifdef CH_USE_DEBUG
- chDbgTrace(ctp, tp);
+ chDbgTrace(otp, ntp);
#endif
- chSysSwitchI(&ctp->p_ctx, &tp->p_ctx);
+ chSysSwitchI(&otp->p_ctx, &ntp->p_ctx);
}
}
|