From 68003a03c299850f0b66adfa4df6c9d6b6ba6ab2 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 23 Jan 2008 14:50:42 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@182 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chsem.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'src/chsem.c') 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; } -- cgit v1.2.3