aboutsummaryrefslogtreecommitdiffstats
path: root/os/rt/src/chcond.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-02-12 09:43:27 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-02-12 09:43:27 +0000
commit6c90d27a46cfeb8970eec2cf9d41729202d0e40b (patch)
tree75c38e7256a44bdbaeb3d11c1d5e9ca78c08c09b /os/rt/src/chcond.c
parent1033792b73022cbf5a7ef741313ae18592306251 (diff)
downloadChibiOS-6c90d27a46cfeb8970eec2cf9d41729202d0e40b.tar.gz
ChibiOS-6c90d27a46cfeb8970eec2cf9d41729202d0e40b.tar.bz2
ChibiOS-6c90d27a46cfeb8970eec2cf9d41729202d0e40b.zip
Preparation to recursive mutexes, now unlock primitives have the mutex as parameter.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6706 35acf78f-673a-0410-8e92-d51de3d6d3f4
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);