<< Previous | Next >>

OSSemAccept

INT16U OSSemAccept( OS_EVENT * pevent );

Description

This function checks the semaphore to see if a resource is available or if an event occurred. Unlike OSSemPend(), OSSemAccept() does not suspend the calling task if the resource is not available or the event did not occur.

Parameters

pevent
Pointer to the desired semaphore's event control block

Return value

Semaphore value:
If >0, semaphore value is decremented; value is returned before the decrement.
If 0, then either resource is unavailable, event did not occur, or null or invalid pointer was passed to the function.

Library

UCOS2.LIB

See also

OSSemCreate, OSSemPend, OSSemPost, OSSemQuery


Dynamic C Functions << Previous | Next >> rabbit.com