diff options
| author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-03-27 12:33:31 +0000 |
|---|---|---|
| committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-03-27 12:33:31 +0000 |
| commit | 165bcc4a0708ff3252fe73156eace36b5980dbf9 (patch) | |
| tree | 713cd625a9645d3313a773f696e3ad09df58b93b /src/chsem.c | |
| parent | ef14f74f92fb52d0028eb36b7b48b7e7c4ef52c4 (diff) | |
| download | ChibiOS-165bcc4a0708ff3252fe73156eace36b5980dbf9.tar.gz ChibiOS-165bcc4a0708ff3252fe73156eace36b5980dbf9.tar.bz2 ChibiOS-165bcc4a0708ff3252fe73156eace36b5980dbf9.zip | |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@249 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chsem.c')
| -rw-r--r-- | src/chsem.c | 12 |
1 files changed, 9 insertions, 3 deletions
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 */
|
