summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-10 00:24:37 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2009-03-10 00:24:37 +0000
commitad9a0c7bb97d5f69e8e1038b20f5536b168d5295 (patch)
tree49facf679b572841e269cce488b917c0279b553a
parent6d4bec40451240221e408b57c06e0ab2d0d06b71 (diff)
downloadnuttx-ad9a0c7bb97d5f69e8e1038b20f5536b168d5295.tar.gz
nuttx-ad9a0c7bb97d5f69e8e1038b20f5536b168d5295.tar.bz2
nuttx-ad9a0c7bb97d5f69e8e1038b20f5536b168d5295.zip
Fix priority inheritance bug
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1584 42af7a65-404d-4744-a932-0658087f49c3
-rw-r--r--nuttx/sched/sem_wait.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/nuttx/sched/sem_wait.c b/nuttx/sched/sem_wait.c
index d0735d76e..9facd861f 100644
--- a/nuttx/sched/sem_wait.c
+++ b/nuttx/sched/sem_wait.c
@@ -175,9 +175,14 @@ int sem_wait(FAR sem_t *sem)
* cannot cause a context switch because we have preemption
* disabled. The task will be marked "pending" and the switch
* will occur during up_block_task() processing.
+ *
+ * NOTE that we have to restore base_priority because
+ * up_reprioritize_rtr() should set both.
*/
-
+
+ int base_priority = htcb->base_priority;
up_reprioritize_rtr(htcb, rtcb->sched_priority);
+ htcb->base_priority = base_priority;
}
#endif
/* Add the TCB to the prioritized semaphore wait queue */