aboutsummaryrefslogtreecommitdiffstats
path: root/src/chmtx.c
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-02-07 12:56:06 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2009-02-07 12:56:06 +0000
commita13c32870977d0b368520d5cd667b1a904a899e7 (patch)
tree871ccd7568ea90fdc7a52ee86043506fb9f3ed72 /src/chmtx.c
parent24f0bf2a223a6fbf26c823a9423b291b179fa8e6 (diff)
downloadChibiOS-a13c32870977d0b368520d5cd667b1a904a899e7.tar.gz
ChibiOS-a13c32870977d0b368520d5cd667b1a904a899e7.tar.bz2
ChibiOS-a13c32870977d0b368520d5cd667b1a904a899e7.zip
Fixed problem with priority enqueued semaphores during mutexes-related priority boost.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@738 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'src/chmtx.c')
-rw-r--r--src/chmtx.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/chmtx.c b/src/chmtx.c
index e441a5729..ffcab9d2f 100644
--- a/src/chmtx.c
+++ b/src/chmtx.c
@@ -83,20 +83,26 @@ void chMtxLockS(Mutex *mp) {
switch (tp->p_state) {
/* thread tp is waiting on a mutex? */
case PRWTMTX:
- /* requeue tp with its new priority on the mutex wait queue */
+ /* Requeues tp with its new priority on the mutex wait queue. */
prio_insert(dequeue(tp), &tp->p_wtmtxp->m_queue);
/* boost the owner of this mutex if needed */
tp = tp->p_wtmtxp->m_owner;
continue;
+#if CH_USE_SEMAPHORES_PRIORITY
+ case PRWTSEM:
+ /* Requeues tp with its new priority on the semaphore queue. */
+ prio_insert(dequeue(tp), &tp->p_wtsemp->s_queue);
+ break;
+#endif
#if CH_USE_MESSAGES_PRIORITY
case PRSNDMSG:
- /* requeue tp with its new priority on (?) */
+ /* Requeues tp with its new priority on the server thread queue. */
prio_insert(dequeue(tp), &tp->p_wtthdp->p_msgqueue);
break;
#endif
/* thread tp is ready? */
case PRREADY:
- /* requeue tp with its new priority on the ready list */
+ /* Requeue tp with its new priority on the ready list. */
chSchReadyI(dequeue(tp));
}
break;