From 1900d5219352d8a0d29672a4bf58956fe5e65620 Mon Sep 17 00:00:00 2001 From: patacongo Date: Tue, 14 Sep 2010 13:42:15 +0000 Subject: Fix priority inheritance bug git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2949 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/sched/sem_holder.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'nuttx/sched/sem_holder.c') diff --git a/nuttx/sched/sem_holder.c b/nuttx/sched/sem_holder.c index 6db6867c8..1c3126f2d 100644 --- a/nuttx/sched/sem_holder.c +++ b/nuttx/sched/sem_holder.c @@ -816,7 +816,7 @@ void sem_restorebaseprio(FAR _TCB *stcb, FAR sem_t *sem) * Function: sem_canceled * * Description: - * Called from sem_post() after a thread that was waiting for a semaphore + * Called from sem_waitirq() after a thread that was waiting for a semaphore * count was awakened because of a signal and the semaphore wait has been * canceled. This function restores the correct thread priority of each * holder of the semaphore. @@ -831,17 +831,15 @@ void sem_restorebaseprio(FAR _TCB *stcb, FAR sem_t *sem) * ****************************************************************************/ -void sem_canceled(FAR sem_t *sem) +void sem_canceled(FAR _TCB *stcb, FAR sem_t *sem) { - FAR _TCB *rtcb = (FAR _TCB*)g_readytorun.head; - /* Check our assumptions */ DEBUGASSERT(sem->semcount <= 0); /* Adjust the priority of every holder as necessary */ - (void)sem_foreachholder(sem, sem_restoreholderprio, rtcb); + (void)sem_foreachholder(sem, sem_restoreholderprio, stcb); } /**************************************************************************** -- cgit v1.2.3