www.beck-ipc.com

@CHIP-RTOS C Library - RTOS API


RTX_Wait_Sem

Wait on a counting semaphore.

int RTX_Wait_Sem ( int semID, long far *time_ms );

Parameters

semID

The semaphore ID of a counting semaphore acquired by a call to RTX_Create_Sem.

time_ms

Pointer for ms to wait: Zero -> Wait forever for semaphore
Positive value -> Maximum number of milliseconds to wait for resource
Negative value -> Polling mode, return immediately.   If semaphore was not available the return value will be the -27 time-out indication.

Return Value

0 on success else error code.

Comments

This call waits for a defined time on a semaphore and returns with an error if the semaphore is still in use by other callers ("busy" condition is represented by a semaphore count of zero).   Otherwise the semaphore count is decremented by one and the caller is granted the semaphore.

The wait priority used here is 20.   (See the RTX_Wait_Sem_Priority alternative API for explanation of wait priority.)

See Also

RTOS API

This library function invokes a RTOS software interrupt. Refer to this RTOS API function's documentation for more details.

Related Topics

RTX API   Overview

Supported since or modified in @CHIP-RTOS version

    SC12SC13SC11SC1x3SC2x
    V1.00V1.00V1.00V0.90V1.00

This API List
List of C Libraries
@CHIP-RTOS Main Index


End of document