Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

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

  1. Do not use this function if the semaphore is used to protect a shared resource.

Example Usage