aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/src/chcond.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/rt/src/chcond.c')
-rw-r--r--os/rt/src/chcond.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/os/rt/src/chcond.c b/os/rt/src/chcond.c
index cc3ee2e40..18c0e1c8c 100644
--- a/os/rt/src/chcond.c
+++ b/os/rt/src/chcond.c
@@ -210,7 +210,8 @@ msg_t chCondWaitS(condition_variable_t *cp) {
chDbgCheck(cp != NULL);
chDbgAssert(ctp->p_mtxlist != NULL, "not owning a mutex");
- mp = chMtxUnlockS();
+ mp = chMtxGetNextMutex();
+ chMtxUnlockS(mp);
ctp->p_u.wtobjp = cp;
queue_prio_insert(ctp, &cp->c_queue);
chSchGoSleepS(CH_STATE_WTCOND);
@@ -293,7 +294,8 @@ msg_t chCondWaitTimeoutS(condition_variable_t *cp, systime_t time) {
chDbgCheck((cp != NULL) && (time != TIME_IMMEDIATE));
chDbgAssert(currp->p_mtxlist != NULL, "not owning a mutex");
- mp = chMtxUnlockS();
+ mp = chMtxGetNextMutex();
+ chMtxUnlockS(mp);
currp->p_u.wtobjp = cp;
queue_prio_insert(currp, &cp->c_queue);
msg = chSchGoSleepTimeoutS(CH_STATE_WTCOND, time);