@CHIP-RTOS C Library V2.00 - RTOS API
RTX_Create_Sem
Create either a counting or resource
semaphore. int RTX_Create_Sem ( int far *semID, const char far *name,
int initvalue ); Parameters
semID
- Output Parameter: pointer to where semaphore
ID will be written.
name
- Input Parameter: pointer to a four character name
for the new semaphore. This string need not be zero terminated,
but must contain four bytes.
initvalue
- New semaphore's initial value. Set this to -1
to create a resource semaphore. For counting semaphore's set
this to some non-negative number representing the number of resources
initially available on this new semaphore.
Return Value
- 0 on success else
error code.
Comments
- The semaphore name is only relevant if the
RTX_Find_Sem service will be used.
Otherwise, setting this field to all zeros can avoid namespace conflicts with
other semaphores which do use the name lookup service.
See Also
RTOS API
- This library function invokes a RTOS software interrupt.
Refer to this RTOS API function's
documentation
for more details.
This API List
List of C Libraries
@CHIP-RTOS Main Index
End of document
|