BoolE OsAllEvents( OsEventsT events );
Function OsAllEvents() may be called by the client application to test the events associated with the currently running task against all of a specified set of events. The function returns Bool_TRUE (non-zero) if all events that are set in the function argument are also set in the running task's event pattern. Otherwise, the function returns Bool_FALSE (zero). The task's event pattern is not changed.
The example below shows part of a task that processes some input data, buffers it and passes it to an output of some sort. Input data must be processed only when both events ENABLE_INPUT and DO_INPUT are set. This event pattern is formed with a bit-wise OR operation and passed as the argument of OsAllEvents(). If the function returns Bool_TRUE, which is non-zero, the task enters the body of the if statement and processes the input data.
if ( OsAllEvents( ENABLE_INPUT | DO_INPUT ) )
{
/* ... process input ... */
if ( bufferCount > 0 )
OsSetEvents( DO_OUTPUT );
OsAcceptEvents( DO_INPUT );
if ( bufferCount == BUFFER_SIZE )
OsAcceptEvents( ENABLE_INPUT );
}