IPC@CHIP® RTOS-PPC – API Documentation

Header image

Main page


RTX_EC RTX_NewSem ( RTX_ID semID,
const char *  name,
int  initvalue 
)

This API creates a new resource or counting semaphore.

A semaphore requires the use of one general purpose kernel object, of which the system has a total of 500.

CAUTION:

A priority inheritance type semaphore must be used with extreme care. No @CHIP-RTOS-PPC API should be called when a task owns such a semaphore other than RTX_Release_Sem() or RTX_Free_Sem() API. To violate this rule can lead to undefined behavior.
Parameters:
semID Output parameter: New semaphore ID (handle) will be written here by this API. Caller must provide the memory.
name Up to 4 character name to give new semaphore. Nil terminator is optional.
initvalue Semaphore initial value. A counting semaphore is created by setting this parameter to a non-negative value. A normal resource type semaphore is created with a -1 (RTX_RESOURCE_SEM_TYPE). A priority inheritance type resource semaphore is created with a -2 (RTX_RESOURCE_SEM_PI_TYPE).
Compatibility:
Not available in SC1x, SC2x and SC1x3 systems. When source code compatibility is required, the wrapper macro RTX_Create_Sem() should be used. The priority inheritance type resource semaphore (RTX_RESOURCE_SEM_PI_TYPE) is not available in the SC1x, SC2x and SC1x3 C-Library.
Returns:
Zero on success, else an error code.
See also:
RTX_Delete_Sem()
Since:
SC2x3 V1.00 - CLIB V1.00





Top of page | Main page

Copyright © 2017 Beck IPC GmbH
Generated on Thu Jan 26 16:21:37 2017 by Doxygen 1.6.1