aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/src
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-04-28 15:43:08 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-04-28 15:43:08 +0000
commitfea81eee7795e769c1e37837d555cab3c6a0a14e (patch)
tree0faaa4690b6acc755636213b6f8c20ce01899814 /os/rt/src
parentfc1588e68475c356a215a49850874e9142010111 (diff)
downloadChibiOS-fea81eee7795e769c1e37837d555cab3c6a0a14e.tar.gz
ChibiOS-fea81eee7795e769c1e37837d555cab3c6a0a14e.tar.bz2
ChibiOS-fea81eee7795e769c1e37837d555cab3c6a0a14e.zip
Small API change for consistency.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@11970 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os/rt/src')
-rw-r--r--os/rt/src/chcond.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/os/rt/src/chcond.c b/os/rt/src/chcond.c
index 1881f1f63..8ee07a814 100644
--- a/os/rt/src/chcond.c
+++ b/os/rt/src/chcond.c
@@ -204,15 +204,14 @@ msg_t chCondWait(condition_variable_t *cp) {
*/
msg_t chCondWaitS(condition_variable_t *cp) {
thread_t *ctp = currp;
- mutex_t *mp;
+ mutex_t *mp = chMtxGetNextMutexX();
msg_t msg;
chDbgCheckClassS();
chDbgCheck(cp != NULL);
- chDbgAssert(ctp->mtxlist != NULL, "not owning a mutex");
+ chDbgAssert(mp != NULL, "not owning a mutex");
- /* Getting "current" mutex and releasing it.*/
- mp = chMtxGetNextMutexS();
+ /* Releasing "current" mutex.*/
chMtxUnlockS(mp);
/* Start waiting on the condition variable, on exit the mutex is taken
@@ -294,15 +293,14 @@ msg_t chCondWaitTimeout(condition_variable_t *cp, sysinterval_t timeout) {
* @sclass
*/
msg_t chCondWaitTimeoutS(condition_variable_t *cp, sysinterval_t timeout) {
- mutex_t *mp;
+ mutex_t *mp = chMtxGetNextMutexX();
msg_t msg;
chDbgCheckClassS();
chDbgCheck((cp != NULL) && (timeout != TIME_IMMEDIATE));
- chDbgAssert(currp->mtxlist != NULL, "not owning a mutex");
+ chDbgAssert(mp != NULL, "not owning a mutex");
- /* Getting "current" mutex and releasing it.*/
- mp = chMtxGetNextMutexS();
+ /* Releasing "current" mutex.*/
chMtxUnlockS(mp);
/* Start waiting on the condition variable, on exit the mutex is taken