VxWorks Reference Manual : Libraries

semOLib

NAME

semOLib - release 4.x binary semaphore library

ROUTINES

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

DESCRIPTION

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.

INCLUDE FILES

semLib.h

SEE ALSO

semOLib, semLib, semBLib, VxWorks Programmer's Guide: Basic OS


Libraries : Routines

semCreate( )

NAME

semCreate( ) - create and initialize a release 4.x binary semaphore

SYNOPSIS


SEM_ID semCreate (void)

DESCRIPTION

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.

RETURNS

The semaphore ID, or NULL if memory cannot be allocated.

SEE ALSO

semOLib, semInit( )


Libraries : Routines

semInit( )

NAME

semInit( ) - initialize a static binary semaphore

SYNOPSIS

STATUS semInit
    (
    SEMAPHORE * pSemaphore /* 4.x semaphore to initialize */
    )

DESCRIPTION

This routine initializes static VxWorks 4.x semaphores. In some instances, a semaphore cannot be created with semCreate( ) but is a static object.

RETURNS

OK, or ERROR if the semaphore cannot be initialized.

SEE ALSO

semOLib, semCreate( )


Libraries : Routines

semClear( )

NAME

semClear( ) - take a release 4.x semaphore, if the semaphore is available

SYNOPSIS

STATUS semClear
    (
    SEM_ID semId /* semaphore ID to empty */
    )

DESCRIPTION

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.

RETURNS

OK, or ERROR if the semaphore is unavailable.

SEE ALSO

semOLib