nuttx/sched/semaphore
David Sidrane 3cc2a4f7c9 sem_holder: Fixes improper restoration of base_priority
in the case of CONFIG_SEM_PREALLOCHOLDERS=0

   The call to sem_restorebaseprio_task context switches in the
   sem_foreachholder(sem, sem_restoreholderprioB, stcb); call
   prior to releasing the holder. So the running task is left
   as a holder as is the started task. Leaving both slots filled
   Thus failing to perforem the boost/or restoration on the
   correct tcb.

   This PR fixes this by releasing the running task slot prior
   to reprioritization that can lead to the context switch.
   To faclitate this, the interface to sem_restorebaseprio
   needed to take the tcb from the holder prior to the
   holder being freed. In the failure case where sched_verifytcb
   fails it added the overhead of looking up the holder.

   There is also the adfitinal thunking on the foreach to
   get from holer to holder->tcb.

   An alternate approach could be to leve the interface the same
   and allocate a holder on the stack of sem_restoreholderprioB
   copy the sem's holder to it, free it as is done in this pr
   and and then pass that address sem_restoreholderprio as the
   holder. It could then get the holder's tcb but we would
   keep the same sem_findholder in sched_verifytcb.
2017-03-15 17:12:45 -10:00
..
Make.defs sem_setprotocol: Handle a case of missing proxy for sem_setprotocol. Reorder so that (1) this error is avoided, and (2) >No proxy is needed if priority inheritance is not enabled. 2016-11-03 18:51:38 -06:00
sem_destroy.c Remove some empty file section section header comments 2016-02-17 17:38:39 -06:00
sem_holder.c sem_holder: Fixes improper restoration of base_priority 2017-03-15 17:12:45 -10:00
sem_initialize.c sem_tickwait(): Add a new, non-standard function to perform timed semaphore waits. It is functionally equialent to the standard sem_timedwait(), but more efficient for use in higher performance device drivers. Requested by Max Neklyudov 2015-08-01 07:31:09 -06:00
sem_post.c Add some comments. 2016-11-05 09:44:29 -06:00
sem_recover.c nuttx/sched: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-14 08:17:46 -06:00
sem_reset.c Update some comments 2016-03-06 13:50:26 -06:00
sem_setprotocol.c Missing # on endif 2016-11-03 21:27:52 -06:00
sem_tickwait.c nuttx/sched: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-14 08:17:46 -06:00
sem_timedwait.c Move cancellation point definitions to their own header file. 2016-12-10 09:08:26 -06:00
sem_timeout.c nuttx/sched: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-14 08:17:46 -06:00
sem_trywait.c sem_wait() and sem_trywait() no longer modify the errno value UNLESS an error occurs. This allows these functions to be used internallly without clobbering the errno value. 2016-11-09 07:01:49 -06:00
sem_wait.c Cancellation points: Fix some backward logic in conditional compilation. 2017-02-02 06:42:41 -06:00
sem_waitirq.c nuttx/sched: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-14 08:17:46 -06:00
semaphore.h Within the OS, when a thread obtains a semaphore count it must call sem_addholder() if CONFIG_PRIORITY_INHERITANCE is enabled. If a count is available, then sem_wait() calls sem_addholder(), otherwise it waited for the semaphore and called sem_addholder() when it eventually received the count. 2016-10-26 07:23:15 -06:00
spinlock.c SMP: There were certain conditions that we must avoid by preventing releasing the pending tasks while withn a critical section. But this logic was incomplete; there was no logic to prevent other CPUs from adding new, running tasks while on CPU is in a critical section. 2016-12-27 08:49:07 -06:00