From 165bcc4a0708ff3252fe73156eace36b5980dbf9 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Thu, 27 Mar 2008 12:33:31 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@249 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chsem.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/chsem.c') diff --git a/src/chsem.c b/src/chsem.c index 14b8567ad..d1199f072 100644 --- a/src/chsem.c +++ b/src/chsem.c @@ -188,10 +188,12 @@ void chSemSignalI(Semaphore *sp) { * Performs atomic signal and wait operations on two semaphores. * @param sps pointer to a \p Semaphore structure to be signaled * @param spw pointer to a \p Semaphore structure to be wait on - * @note The function is available only if the \p CH_USE_SEMAPHORES + * @return the function can return \p RDY_OK or \p RDY_RESET. + * @note The function is available only if the \p CH_USE_SEMSW * option is enabled in \p chconf.h. */ -void chSemSignalWait(Semaphore *sps, Semaphore *spw) { +msg_t chSemSignalWait(Semaphore *sps, Semaphore *spw) { + msg_t msg; chSysLock(); @@ -202,11 +204,15 @@ void chSemSignalWait(Semaphore *sps, Semaphore *spw) { fifo_insert(currp, &spw->s_queue); currp->p_wtsemp = spw; chSchGoSleepS(PRWTSEM); + msg = currp->p_rdymsg; } - else + else { chSchRescheduleS(); + msg = RDY_OK; + } chSysUnlock(); + return msg; } #endif /* CH_USE_SEMSW */ -- cgit v1.2.3