diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-01-21 18:06:33 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2010-01-21 18:06:33 +0000 |
commit | ea02b6612f7f377f77cbdebe29d0d52f30e5fdeb (patch) | |
tree | 4d0a85d724aab15345eee929f15da058ce989d54 | |
parent | 6ce39015268cb3a30adc9890a312be39857e1464 (diff) | |
download | ChibiOS-ea02b6612f7f377f77cbdebe29d0d52f30e5fdeb.tar.gz ChibiOS-ea02b6612f7f377f77cbdebe29d0d52f30e5fdeb.tar.bz2 ChibiOS-ea02b6612f7f377f77cbdebe29d0d52f30e5fdeb.zip |
Condvars optimizations.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1537 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | os/kernel/src/chcond.c | 18 | ||||
-rw-r--r-- | readme.txt | 5 |
2 files changed, 13 insertions, 10 deletions
diff --git a/os/kernel/src/chcond.c b/os/kernel/src/chcond.c index a7ba23ed5..9e1a70cc4 100644 --- a/os/kernel/src/chcond.c +++ b/os/kernel/src/chcond.c @@ -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;
}
diff --git a/readme.txt b/readme.txt index 294050f6d..04b619421 100644 --- a/readme.txt +++ b/readme.txt @@ -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 ***
|