diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-01-07 10:49:59 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2008-01-07 10:49:59 +0000 |
commit | 14d3b059c225769038a0f3538f491cf6099dbb3e (patch) | |
tree | b4049b72b26d9247cdeb4adbf2b6ace9600ba554 /src | |
parent | dc39fea05ea07302e2c51fbfbf6b37530b124577 (diff) | |
download | ChibiOS-14d3b059c225769038a0f3538f491cf6099dbb3e.tar.gz ChibiOS-14d3b059c225769038a0f3538f491cf6099dbb3e.tar.bz2 ChibiOS-14d3b059c225769038a0f3538f491cf6099dbb3e.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@165 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src')
-rw-r--r-- | src/chmtx.c | 9 |
1 files changed, 6 insertions, 3 deletions
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;
/*
|