VxWorks Reference Manual : Libraries
semOLib - release 4.x binary semaphore library
semCreate( ) - create and initialize a release 4.x binary semaphore
semInit( ) - initialize a static binary semaphore
semClear( ) - take a release 4.x semaphore, if the semaphore is available
This library is provided for backward compatibility with VxWorks 4.x semaphores. The semaphores are identical to 5.0 binary semaphores, except that timeouts -- missing or specified -- are ignored.
For backward compatibility, semCreate( ) operates as before, allocating and initializing a 4.x-style semaphore. Likewise, semClear( ) has been implemented as a semTake( ), with a timeout of NO_WAIT.
For more information on of the behavior of binary semaphores, see the manual entry for semBLib.
semLib.h
semOLib, semLib, semBLib, VxWorks Programmer's Guide: Basic OS
semCreate( ) - create and initialize a release 4.x binary semaphore
SEM_ID semCreate (void)
This routine allocates a VxWorks 4.x binary semaphore. The semaphore is initialized to empty. After initialization, it must be given before it can be taken.
The semaphore ID, or NULL if memory cannot be allocated.
semInit( ) - initialize a static binary semaphore
STATUS semInit ( SEMAPHORE * pSemaphore /* 4.x semaphore to initialize */ )
This routine initializes static VxWorks 4.x semaphores. In some instances, a semaphore cannot be created with semCreate( ) but is a static object.
OK, or ERROR if the semaphore cannot be initialized.
semClear( ) - take a release 4.x semaphore, if the semaphore is available
STATUS semClear ( SEM_ID semId /* semaphore ID to empty */ )
This routine takes a VxWorks 4.x semaphore if it is available (full), otherwise no action is taken except to return ERROR. This routine never preempts the caller.
OK, or ERROR if the semaphore is unavailable.