SEM_post
Application Program Interface
2-379
C Interface
Syntax
SEM_post(sem);
Parameters
SEM_Handle sem;
/* semaphore object handle */
Return Value
Void
Description
SEM_pend and SEM_post are for use with counting semaphores, which
keep track of the number of times the semaphore has been posted. This
is useful, for example, if you have a group of resources that are shared
between tasks.
In contrast, SEM_pendBinary and SEM_postBinary are for use with
binary semaphores, which can have only an available or unavailable
state. The APIs for binary and counting semaphores cannot be mixed for
a single semaphore.
SEM_post readies the first task waiting for the semaphore. If no task is
waiting, SEM_post simply increments the semaphore count and returns.
A task switch occurs when calling SEM_post if a higher priority task is
made ready to run.
Constraints and
Calling Context
❏
When called within an HWI, the code sequence calling SEM_post
must be either wrapped within an HWI_enter/HWI_exit pair or
invoked by the HWI dispatcher.
❏
If SEM_post is called from within a TSK_disable/TSK_enable block,
the semaphore operation is not processed until TSK_enable is
called.
See Also
SEM_post
Signal a semaphore