|
|
Semaphore function. This function tries to get the semaphore object. If the semaphore is in nonsignalized state (that means its counter is zero or less), this function blocks the task execution until the semaphore gets signaled or a timeout happens. - Parameters:
-
| sema | handle to the semaphore object. |
| timeoutticks | timeout in timer ticks (see HZ define and MS macro). If this parameter is set to zero, the function immediately returns. If this parameter is set to INFINITE, the function will never time out. |
- Returns:
- zero on success. A positive value (1 or TRUE) is returned when the timeout was reached.
- Note:
- NOSCFG_FEATURE_SEMAPHORES must be defined to 1 to have semaphore support compiled in.
POSCFG_FEATURE_SEMAWAIT must be defined to 1 to have this function compiled in.
Dependent of your configuration, this function can be defined as macro to decrease code size.
- See also:
- nosSemaGet, nosSemaSignal, nosSemaCreate, HZ, MS
|