From 6c90d27a46cfeb8970eec2cf9d41729202d0e40b Mon Sep 17 00:00:00 2001 From: gdisirio Date: Wed, 12 Feb 2014 09:43:27 +0000 Subject: 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 --- os/rt/src/chcond.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'os/rt/src/chcond.c') 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); -- cgit v1.2.3