||const char *
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.
- 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.
|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). |
- 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.
- Zero on success, else an error code.
- See also:
- SC2x3 V1.00 - CLIB V1.00