Changeset 31157bc in rtems-docs


Ignore:
Timestamp:
Jan 23, 2017, 12:44:43 PM (3 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
ffe8197
Parents:
7b52e8f
Message:

c-user: Clarify simple binary semaphore release

Close #2725.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c-user/semaphore_manager.rst

    r7b52e8f r31157bc  
    4444while a counting semaphore can assume any non-negative integer value.
    4545
    46 A binary semaphore can be used to control access to a single resource.  In
    47 particular, it can be used to enforce mutual exclusion for a critical section
    48 in user code.  In this instance, the semaphore would be created with an initial
    49 count of one to indicate that no task is executing the critical section of
    50 code.  Upon entry to the critical section, a task must issue the
    51 ``rtems_semaphore_obtain`` directive to prevent other tasks from entering the
    52 critical section.  Upon exit from the critical section, the task must issue the
     46A binary semaphore (not a simple binary semaphore) can be used to control
     47access to a single resource.  In particular, it can be used to enforce mutual
     48exclusion for a critical section in user code (mutex).  In this instance, the
     49semaphore would be created with an initial count of one to indicate that no
     50task is executing the critical section of code.  Upon entry to the critical
     51section, a task must issue the ``rtems_semaphore_obtain`` directive to prevent
     52other tasks from entering the critical section.  Upon exit from the critical
     53section, the task that obtained the binary semaphore must issue the
    5354``rtems_semaphore_release`` directive to allow another task to execute the
    54 critical section.
     55critical section.  A binary semaphore must be released by the task that
     56obtained it.
    5557
    5658A counting semaphore can be used to control access to a pool of two or more
     
    368370can be described as follows:
    369371
    370     If there sre no tasks are waiting on this semaphore then increment the
     372    If there are no tasks are waiting on this semaphore then increment the
    371373    semaphore's count else assign semaphore to a waiting task and return
    372374    SUCCESSFUL.
Note: See TracChangeset for help on using the changeset viewer.