www.beck-ipc.com

@CHIP-RTOS C Library - RTOS API


RTX_Get_Sem

Attempt to access a semaphore, without waiting.

int RTX_Get_Sem ( int semID );

Parameters

semID

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

Return Value

0 on success (semaphore granted) else error code.

Comments

This call returns with an error if the semaphore is not available.   For counting semaphores, available means that the semaphore's count was non-zero.   For resource semaphores, available means that the semaphore "in use" count was either zero or the calling task is the current owner.

This API will decrement an available counting semaphore's count value. For resource semaphores, it will increment the "in use" count if the semaphore was available.

Note:>    On RTOS versions prior to SC1x version 1.27 and SC1x3/SC2x version 1.41, this function was restricted to counting semaphores.   This restriction has been removed.

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.27V1.27V1.27V1.41V1.41

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


End of document