From 14d3b059c225769038a0f3538f491cf6099dbb3e Mon Sep 17 00:00:00 2001 From: gdisirio Date: Mon, 7 Jan 2008 10:49:59 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@165 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- src/chmtx.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'src/chmtx.c') diff --git a/src/chmtx.c b/src/chmtx.c index af2ac0262..25f3ce664 100644 --- a/src/chmtx.c +++ b/src/chmtx.c @@ -99,10 +99,11 @@ void chMtxLockS(Mutex *mp) { * @return \p TRUE if the mutex was successfully acquired else \p FALSE */ BOOL chMtxTryLock(Mutex *mp) { + BOOL b; chSysLock(); - BOOL b = chMtxTryLockS(mp); + b = chMtxTryLockS(mp); chSysUnlock(); return b; @@ -131,6 +132,7 @@ BOOL chMtxTryLockS(Mutex *mp) { * Unlocks the next owned mutex in reverse lock order. */ void chMtxUnlock(void) { + Mutex *mp; chSysLock(); @@ -140,7 +142,7 @@ void chMtxUnlock(void) { /* * Removes the top Mutex from the owned mutexes list and marks it as not owned. */ - Mutex *mp = currp->p_mtxlist; + mp = currp->p_mtxlist; currp->p_mtxlist = mp->m_next; mp->m_owner = NULL; /* @@ -172,6 +174,7 @@ void chMtxUnlock(void) { * @note This function does not reschedule internally. */ void chMtxUnlockS(void) { + Mutex *mp; chDbgAssert((currp->p_mtxlist != NULL) && (currp->p_mtxlist->m_owner == currp), "chmtx.c, chMtxUnlockS()"); @@ -179,7 +182,7 @@ void chMtxUnlockS(void) { /* * Removes the top Mutex from the owned mutexes list and marks it as not owned. */ - Mutex *mp = currp->p_mtxlist; + mp = currp->p_mtxlist; currp->p_mtxlist = mp->m_next; mp->m_owner = NULL; /* -- cgit v1.2.3