diff --git a/os/kernel/src/chmsg.c b/os/kernel/src/chmsg.c index 2f5a7a127..6c0c6a81a 100644 --- a/os/kernel/src/chmsg.c +++ b/os/kernel/src/chmsg.c @@ -44,17 +44,18 @@ * @return The return message from @p chMsgRelease(). */ msg_t chMsgSend(Thread *tp, msg_t msg) { + Thread *ctp = currp; chDbgCheck(tp != NULL, "chMsgSend"); chSysLock(); - currp->p_msg = msg; - currp->p_u.wtobjp = &tp->p_msgqueue; - msg_insert(currp, &tp->p_msgqueue); + ctp->p_msg = msg; + ctp->p_u.wtobjp = &tp->p_msgqueue; + msg_insert(ctp, &tp->p_msgqueue); if (tp->p_state == THD_STATE_WTMSG) chSchReadyI(tp); chSchGoSleepS(THD_STATE_SNDMSG); - msg = currp->p_u.rdymsg; + msg = ctp->p_u.rdymsg; chSysUnlock(); return msg; } diff --git a/readme.txt b/readme.txt index 52364ff3d..08952fe6f 100644 --- a/readme.txt +++ b/readme.txt @@ -60,6 +60,7 @@ do not support this non standard construct. - CHANGE: Modified the thread-related constant macros to have a THD_ prefix. - OPT: Optimizations to the priority inheritance code. +- OPT: Speed/size optimization to the synchronous messages subsystem. *** 1.3.8 *** - FIX: Fixed dequeuing in lifo_remove() function (bug 2928142).