Description
Changes the current value of the semaphore count. This function is normally selected when a semaphore is used as a signaling mechanism. OSSemSet()
can then be used to reset the count to any value. If the semaphore count is already 0, the count is only changed if there are no tasks waiting on the semaphore.
Files
os.h/os_sem.c
Prototype
Arguments
p_sem
is a pointer to the semaphore that is used as a signaling mechanism.
...
If tasks are waiting on the semaphore.
Returned Value
None
Required Configuration
OS_CFG_SEM_EN
and OS_CFG_SEM_SET_EN
must be enabled in os_cfg.h. Refer to uC-OS-III Configuration Manual
Callers
Application.
Notes/Warnings
- Do not use this function if the semaphore is used to protect a shared resource.