diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-09-14 13:42:15 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2010-09-14 13:42:15 +0000 |
commit | 1900d5219352d8a0d29672a4bf58956fe5e65620 (patch) | |
tree | 0bb50ce7b1395fc9d9c72171c0c3ad2e5935f01c /nuttx/sched/sem_holder.c | |
parent | 4395c30614b96e828e0c64e8164b36d906b444c7 (diff) | |
download | px4-nuttx-1900d5219352d8a0d29672a4bf58956fe5e65620.tar.gz px4-nuttx-1900d5219352d8a0d29672a4bf58956fe5e65620.tar.bz2 px4-nuttx-1900d5219352d8a0d29672a4bf58956fe5e65620.zip |
Fix priority inheritance bug
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2949 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/sched/sem_holder.c')
-rw-r--r-- | nuttx/sched/sem_holder.c | 8 |
1 files changed, 3 insertions, 5 deletions
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); } /**************************************************************************** |