From a13c32870977d0b368520d5cd667b1a904a899e7 Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 7 Feb 2009 12:56:06 +0000 Subject: 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 --- src/chmtx.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'src/chmtx.c') 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; -- cgit v1.2.3