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 ***