Condvars optimizations.

git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1537 35acf78f-673a-0410-8e92-d51de3d6d3f4
master
gdisirio 2010-01-21 18:06:33 +00:00
parent 6ce3901526
commit ea02b6612f
2 changed files with 13 additions and 10 deletions

View File

@ -138,19 +138,20 @@ msg_t chCondWait(CondVar *cp) {
* @p chCondWaitS().
*/
msg_t chCondWaitS(CondVar *cp) {
Thread *ctp = currp;
Mutex *mp;
msg_t msg;
chDbgCheck(cp != NULL, "chCondWaitS");
chDbgAssert(currp->p_mtxlist != NULL,
chDbgAssert(ctp->p_mtxlist != NULL,
"chCondWaitS(), #1",
"not owning a mutex");
mp = chMtxUnlockS();
prio_insert(currp, &cp->c_queue);
currp->p_u.wtobjp = cp;
prio_insert(ctp, &cp->c_queue);
ctp->p_u.wtobjp = cp;
chSchGoSleepS(THD_STATE_WTCOND);
msg = currp->p_u.rdymsg;
msg = ctp->p_u.rdymsg;
chMtxLockS(mp);
return msg;
}
@ -204,19 +205,20 @@ msg_t chCondWaitTimeout(CondVar *cp, systime_t time) {
* @p chCondWaitTimeoutS().
*/
msg_t chCondWaitTimeoutS(CondVar *cp, systime_t time) {
Thread *ctp = currp;
Mutex *mp;
msg_t msg;
chDbgCheck(cp != NULL, "chCondWaitTimeoutS");
chDbgAssert(currp->p_mtxlist != NULL,
chDbgAssert(ctp->p_mtxlist != NULL,
"chCondWaitTimeoutS(), #1",
"not owning a mutex");
mp = chMtxUnlockS();
prio_insert(currp, &cp->c_queue);
currp->p_u.wtobjp = cp;
prio_insert(ctp, &cp->c_queue);
ctp->p_u.wtobjp = cp;
chSchGoSleepTimeoutS(THD_STATE_WTCOND, time);
msg = currp->p_u.rdymsg;
msg = ctp->p_u.rdymsg;
chMtxLockS(mp);
return msg;
}

View File

@ -52,14 +52,15 @@
*****************************************************************************
*** 1.5.0 ***
- FIX: Fixed parameter check in sdStart() function (bug 2932922)(backported in
1.4.0).
- FIX: Fixed parameter check in sdStart() function (bug 2932922)(backported
in 1.4.0).
- FIX: Fixed missing platform.mk file in MSP430 port (bug 2933735)(backported
in 1.4.0).
- CHANGE: Removed the unnamed union from the Thread structure some compilers
do not support this non standard construct.
- CHANGE: Modified the thread-related constant macros to have a THD_ prefix.
- OPT: Speed/size optimization to the mutexes subsystem.
- OPT: Speed/size optimization to the condvars subsystem.
- OPT: Speed/size optimization to the synchronous messages subsystem.
*** 1.3.8 ***