diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-01-23 14:50:42 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-01-23 14:50:42 +0000 |
commit | 68003a03c299850f0b66adfa4df6c9d6b6ba6ab2 (patch) | |
tree | 719bb767775d1cddb05f070b32b67abfa51a37e9 /src/chsem.c | |
parent | 1aecb14913213565c804dda42322c6fb3136827d (diff) | |
download | ChibiOS-68003a03c299850f0b66adfa4df6c9d6b6ba6ab2.tar.gz ChibiOS-68003a03c299850f0b66adfa4df6c9d6b6ba6ab2.tar.bz2 ChibiOS-68003a03c299850f0b66adfa4df6c9d6b6ba6ab2.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@182 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chsem.c')
-rw-r--r-- | src/chsem.c | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/chsem.c b/src/chsem.c index 0ab603b03..ceaa64399 100644 --- a/src/chsem.c +++ b/src/chsem.c @@ -117,13 +117,6 @@ t_msg chSemWaitS(Semaphore *sp) { }
#ifdef CH_USE_SEMAPHORES_TIMEOUT
-static void wakeup(void *p) {
-
- chDbgAssert(((Thread *)p)->p_state == PRWTSEM, "chsem.c, wakeup()");
- chSemFastSignalI(((Thread *)p)->p_wtsemp);
- chSchReadyI(dequeue(p), RDY_TIMEOUT);
-}
-
/**
* Performs a wait operation on a semaphore with timeout specification.
* @param sp pointer to a \p Semaphore structure
@@ -154,15 +147,9 @@ t_msg chSemWaitTimeout(Semaphore *sp, t_time time) { t_msg chSemWaitTimeoutS(Semaphore *sp, t_time time) {
if (--sp->s_cnt < 0) {
- VirtualTimer vt;
-
- chVTSetI(&vt, time, wakeup, currp);
fifo_insert(currp, &sp->s_queue);
currp->p_wtsemp = sp;
- chSchGoSleepS(PRWTSEM);
- if (chVTIsArmedI(&vt))
- chVTResetI(&vt);
- return currp->p_rdymsg;
+ return chSchGoSleepTimeoutS(PRWTSEM, time);
}
return RDY_OK;
}
|