aboutsummaryrefslogtreecommitdiffstats
path: root/src/chmtx.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-12-23 09:40:50 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2007-12-23 09:40:50 +0000
commit398c024927d7fb31d86c50e081a74a9c8fd45769 (patch)
treeaf4112982962f797147b5c80f4d7e7c72d7cebc2 /src/chmtx.c
parent05b8a7431d43735af86c4a393a06f2e18a4cfe3a (diff)
downloadChibiOS-398c024927d7fb31d86c50e081a74a9c8fd45769.tar.gz
ChibiOS-398c024927d7fb31d86c50e081a74a9c8fd45769.tar.bz2
ChibiOS-398c024927d7fb31d86c50e081a74a9c8fd45769.zip
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@159 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chmtx.c')
-rw-r--r--src/chmtx.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/src/chmtx.c b/src/chmtx.c
index d4da170e1..af2ac0262 100644
--- a/src/chmtx.c
+++ b/src/chmtx.c
@@ -212,23 +212,6 @@ void chMtxUnlockAll(void) {
chSysLock();
- chMtxUnlockAllS();
- chSchRescheduleS();
-
- chSysUnlock();
-}
-
-/**
- * Unlocks all the mutexes owned by the invoking thread, this is <b>MUCH MORE</b>
- * efficient than releasing the mutexes one by one and not just because the
- * call overhead, this function does not have any overhead related to the
- * priority inheritance mechanism.
- * @note This function must be called within a \p chSysLock() / \p chSysUnlock()
- * block.
- * @note This function does not reschedule internally.
- */
-void chMtxUnlockAllS(void) {
-
if (currp->p_mtxlist != NULL) {
do {
Mutex *mp = currp->p_mtxlist;
@@ -238,7 +221,10 @@ void chMtxUnlockAllS(void) {
chSchReadyI(fifo_remove(&mp->m_queue), RDY_OK);
} while (currp->p_mtxlist != NULL);
currp->p_prio = currp->p_realprio;
+ chSchRescheduleS();
}
+
+ chSysUnlock();
}
#endif /* CH_USE_MUTEXES */