aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-01-20 21:53:29 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-01-20 21:53:29 +0000
commit52b8dbd75d4d9d25c20591043c625680af90397e (patch)
treea8640465ec0abf66d9587d187ec321e8529813e8 /src
parent2debe881379d58a4fa92a984471a02e7f5de07c4 (diff)
downloadChibiOS-52b8dbd75d4d9d25c20591043c625680af90397e.tar.gz
ChibiOS-52b8dbd75d4d9d25c20591043c625680af90397e.tar.bz2
ChibiOS-52b8dbd75d4d9d25c20591043c625680af90397e.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@653 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src')
-rw-r--r--src/chschd.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/chschd.c b/src/chschd.c
index 913cac83d..e568ac64a 100644
--- a/src/chschd.c
+++ b/src/chschd.c
@@ -96,12 +96,20 @@ void chSchGoSleepS(tstate_t newstate) {
* Timeout wakeup callback.
*/
static void wakeup(void *p) {
+ Thread *tp = (Thread *)p;
+ switch (tp->p_state) {
#ifdef CH_USE_SEMAPHORES
- if (((Thread *)p)->p_state == PRWTSEM)
- chSemFastSignalI(((Thread *)p)->p_wtsemp);
+ case PRWTSEM:
+ chSemFastSignalI(tp->p_wtsemp);
+ /* Falls into, intentional.*/
#endif
- chSchReadyI(p)->p_rdymsg = RDY_TIMEOUT;
+ case PRWTCOND:
+ chSchReadyI(dequeue(tp))->p_rdymsg = RDY_TIMEOUT;
+ break;
+ default:
+ chSchReadyI(tp)->p_rdymsg = RDY_TIMEOUT;
+ }
}
/**