|
|
|
|
|
Note
Semaphores can also be used
to implement Mutexes. |
|
|
|
|
|
|
|
|
|
TurboTask Semaphores
|
Semaphores allow one or more tasks to suspend when the semaphore is not
available. This allows resource sharing for single thread devices (e.g. an
LCD display). |
| Priority inversion is
automatically avoided in TurboTask semaphores. |
| When more than one
task is waiting on a semaphore, the current task that has the lock has its priority set to
that of the waiting task with the highest priority. This prevents priority
inversion. When the task unlocks the semaphore, its priority is restored and the
task with the highest priority that is waiting is made ready.
|
|
|
|
|