diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-10-03 17:14:03 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2007-10-03 17:14:03 +0000 |
commit | 2310f80695b4051cb63ca14878dfc5e76acb94e6 (patch) | |
tree | 70643e03f918333f051734336f97011644da076a /src/chsem.c | |
parent | 1b269aa139ba66288cc2c3f1b463c73821343262 (diff) | |
download | ChibiOS-2310f80695b4051cb63ca14878dfc5e76acb94e6.tar.gz ChibiOS-2310f80695b4051cb63ca14878dfc5e76acb94e6.tar.bz2 ChibiOS-2310f80695b4051cb63ca14878dfc5e76acb94e6.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@30 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chsem.c')
-rw-r--r-- | src/chsem.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/src/chsem.c b/src/chsem.c index 5c1ff0544..70741c4f0 100644 --- a/src/chsem.c +++ b/src/chsem.c @@ -138,13 +138,9 @@ t_msg chSemWaitTimeout(Semaphore *sp, t_time time) { fifo_insert(currp, &sp->s_queue);
currp->p_semp = sp;
chSchGoSleepI(PRWTSEM);
- msg = currp->p_rdymsg; // Note, got value *before* invoking CH_LEAVE_SYSTEM().
- if (!vt.vt_func) {
-
- chSysUnlock();
- return msg;
- }
- chVTResetI(&vt);
+ msg = currp->p_rdymsg;
+ if (vt.vt_func)
+ chVTResetI(&vt);
chSysUnlock();
return msg;
@@ -173,9 +169,8 @@ t_msg chSemWaitTimeoutS(Semaphore *sp, t_time time) { fifo_insert(currp, &sp->s_queue);
currp->p_semp = sp;
chSchGoSleepI(PRWTSEM);
- if (!vt.vt_func)
- return currp->p_rdymsg;
- chVTResetI(&vt);
+ if (vt.vt_func)
+ chVTResetI(&vt);
return currp->p_rdymsg;
}
return RDY_OK;
@@ -211,6 +206,7 @@ void chSemSignalI(Semaphore *sp) { chSchReadyI(fifo_remove(&sp->s_queue));
}
+#ifdef CH_USE_SEMSW
/**
* Performs atomic signal and wait operations on two semaphores.
* @param sps pointer to a \p Semaphore structure to be signaled
@@ -235,6 +231,7 @@ void chSemSignalWait(Semaphore *sps, Semaphore *spw) { chSysUnlock();
}
+#endif /* CH_USE_SEMSW */
#ifdef CH_USE_RT_SEMAPHORES
/*
@@ -299,6 +296,7 @@ void chSemLowerPrioSignal(Semaphore *sp) { chSysUnlock();
}
+#ifdef CH_USE_SEMSW
/**
* Performs atomic signal and wait operations on two semaphores with priority
* boost.
@@ -326,7 +324,7 @@ void chSemRaisePrioSignalWait(Semaphore *sps, Semaphore *spw) { if (!currp->p_rtcnt++)
currp->p_prio += MEPRIO;
- chSchRescheduleI();
+ chSchRescheduleI(); // Really needed ?
}
chSysUnlock();
@@ -360,6 +358,7 @@ void chSemLowerPrioSignalWait(Semaphore *sps, Semaphore *spw) { chSysUnlock();
}
+#endif /* CH_USE_SEMSW */
#endif /* CH_USE_RT_SEMAPHORES */
|