diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-12 15:02:23 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-11-12 15:02:23 +0000 |
commit | a7ad3ace523d19be103e03f6244e0e797354fe0f (patch) | |
tree | 62234f13c1fcb3477d16f5727b60503900b87f7f /src/chsem.c | |
parent | 48cdf91217fd6460628315a63ccc9e87de21c193 (diff) | |
download | ChibiOS-a7ad3ace523d19be103e03f6244e0e797354fe0f.tar.gz ChibiOS-a7ad3ace523d19be103e03f6244e0e797354fe0f.tar.bz2 ChibiOS-a7ad3ace523d19be103e03f6244e0e797354fe0f.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@87 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chsem.c')
-rw-r--r-- | src/chsem.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/chsem.c b/src/chsem.c index 091a045b5..099dc4db4 100644 --- a/src/chsem.c +++ b/src/chsem.c @@ -112,10 +112,11 @@ void chSemWaitS(Semaphore *sp) { }
#ifdef CH_USE_SEMAPHORES_TIMEOUT
-static void unwait(void *p) {
-
-// Test removed, it should never happen.
-// if (((Thread *)p)->p_state == PRWTSEM)
+static void wakeup(void *p) {
+#ifdef CH_USE_DEBUG
+ if (((Thread *)p)->p_state != PRWTSEM)
+ chDbgPanic("chsem.c, wakeup()\r\n");
+#endif
chSemFastSignalI(((Thread *)p)->p_semp);
chSchReadyI(dequeue(p))->p_rdymsg = RDY_TIMEOUT;
}
@@ -134,7 +135,7 @@ t_msg chSemWaitTimeout(Semaphore *sp, t_time time) { if (--sp->s_cnt < 0) {
VirtualTimer vt;
- chVTSetI(&vt, time, unwait, currp);
+ chVTSetI(&vt, time, wakeup, currp);
fifo_insert(currp, &sp->s_queue);
currp->p_semp = sp;
chSchGoSleepS(PRWTSEM);
@@ -165,7 +166,7 @@ t_msg chSemWaitTimeoutS(Semaphore *sp, t_time time) { if (--sp->s_cnt < 0) {
VirtualTimer vt;
- chVTSetI(&vt, time, unwait, currp);
+ chVTSetI(&vt, time, wakeup, currp);
fifo_insert(currp, &sp->s_queue);
currp->p_semp = sp;
chSchGoSleepS(PRWTSEM);
|