aboutsummaryrefslogtreecommitdiffstats
path: root/os/kernel/src/chschd.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-03-18 16:01:11 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2010-03-18 16:01:11 +0000
commitcf1b70f486a2696d523d585e91d0e4e5c7b8021c (patch)
tree8bb98eff1c20929200b6c89da6b87ff47bd99af8 /os/kernel/src/chschd.c
parent7ae3e3227ee895c3ed5ac3358411b07276c7838e (diff)
downloadChibiOS-cf1b70f486a2696d523d585e91d0e4e5c7b8021c.tar.gz
ChibiOS-cf1b70f486a2696d523d585e91d0e4e5c7b8021c.tar.bz2
ChibiOS-cf1b70f486a2696d523d585e91d0e4e5c7b8021c.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1749 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/kernel/src/chschd.c')
-rw-r--r--os/kernel/src/chschd.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/os/kernel/src/chschd.c b/os/kernel/src/chschd.c
index 9bf34d43a..ac69c6661 100644
--- a/os/kernel/src/chschd.c
+++ b/os/kernel/src/chschd.c
@@ -105,23 +105,21 @@ void chSchGoSleepS(tstate_t newstate) {
}
#endif /* !defined(PORT_OPTIMIZED_GOSLEEPS) */
+#if !defined(PORT_OPTIMIZED_GOSLEEPTIMEOUTS) || defined(__DOXYGEN__)
/*
* Timeout wakeup callback.
*/
static void wakeup(void *p) {
Thread *tp = (Thread *)p;
-#if CH_USE_SEMAPHORES || CH_USE_MUTEXES || CH_USE_CONDVARS
+#if CH_USE_SEMAPHORES || (CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT)
switch (tp->p_state) {
#if CH_USE_SEMAPHORES
case THD_STATE_WTSEM:
chSemFastSignalI((Semaphore *)tp->p_u.wtobjp);
/* Falls into, intentional. */
#endif
-#if CH_USE_MUTEXES
- case THD_STATE_WTMTX:
-#endif
-#if CH_USE_CONDVARS
+#if CH_USE_CONDVARS && CH_USE_CONDVARS_TIMEOUT
case THD_STATE_WTCOND:
#endif
/* States requiring dequeuing.*/
@@ -166,6 +164,7 @@ msg_t chSchGoSleepTimeoutS(tstate_t newstate, systime_t time) {
chSchGoSleepS(newstate);
return currp->p_u.rdymsg;
}
+#endif /* !defined(PORT_OPTIMIZED_GOSLEEPTIMEOUTS) */
/**
* @brief Wakes up a thread.
@@ -191,8 +190,7 @@ void chSchWakeupS(Thread *ntp, msg_t msg) {
if (ntp->p_prio <= currp->p_prio)
chSchReadyI(ntp);
else {
- Thread *otp = currp;
- chSchReadyI(otp);
+ Thread *otp = chSchReadyI(currp);
#if CH_TIME_QUANTUM > 0
rlist.r_preempt = CH_TIME_QUANTUM;
#endif
@@ -225,7 +223,7 @@ void chSchDoRescheduleI(void) {
#endif /* !defined(PORT_OPTIMIZED_DORESCHEDULEI) */
/**
- * @brief Performs a reschedulation if a higher priority thread is runnable.
+ * @brief Performs a reschedule if a higher priority thread is runnable.
* @details If a thread with a higher priority than the current thread is in
* the ready list then make the higher priority thread running.
*/
@@ -238,14 +236,14 @@ void chSchRescheduleS(void) {
#endif /* !defined(PORT_OPTIMIZED_RESCHEDULES) */
/**
- * @brief Evaluates if a reschedulation is required.
+ * @brief Evaluates if a reschedule is required.
* @details The decision is taken by comparing the relative priorities and
* depending on the state of the round robin timeout counter.
* @note This function is meant to be used in the timer interrupt handler
* where @p chVTDoTickI() is invoked.
*
* @retval TRUE if there is a thread that should go in running state.
- * @retval FALSE if a reschedulation is not required.
+ * @retval FALSE if a reschedule is not required.
*/
#if !defined(PORT_OPTIMIZED_ISRESCHREQUIREDEXI) || defined(__DOXYGEN__)
bool_t chSchIsRescRequiredExI(void) {