Commit Graph

10 Commits

Author SHA1 Message Date
Gregory Nutt
6f1c5e7b43 Add some comments. 2016-11-05 09:44:29 -06:00
Gregory Nutt
3e13ed2400 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.
This caused a problem when the thread calling sem_wait() was very low priority.  When it received the count, there may be higher priority threads "hogging" the CPU that prevent the lower priority task from running and, as a result, the sem_addholder() may be delayed indefinitely.

The fix was to have sem_post() call sem_addholder() just before restarting the thread waiting for the semaphore count.

This problem was noted by Benix Vincent who also suggested the solution.
2016-10-26 07:23:15 -06:00
Paul A. Patience
891113dac9 sched/semaphore: Fix setting EINVAL in sem_post() and sem_wait() 2016-06-28 10:15:52 -04:00
Gregory Nutt
6e3107650d nuttx/sched: Replace irqsave() with enter_critical_section(); replace irqrestore() with leave_critical_section() 2016-02-14 08:17:46 -06:00
Gregory Nutt
79d554939e sched/: Fix some spacing issues 2015-10-07 19:59:14 -06:00
Gregory Nutt
cb9e27c3b0 Standardize naming used for public data and function groupings 2015-10-02 16:30:35 -06:00
Gregory Nutt
b4423c1eed Make some file section headers more consistent with standard 2015-04-08 06:47:36 -06:00
Gregory Nutt
fcc2a1bb4b Fix incorrect comment 2014-11-07 15:54:24 -06:00
Gregory Nutt
d798dd37a7 Replace os_internal.h with sched/sched.h in files that actually reference something in sched.h 2014-08-08 17:53:55 -06:00
Gregory Nutt
e10a23ae50 Move environment files from sched/ to sched/environ 2014-08-08 13:53:29 -06:00