The wait method blocks the
task making the call until some other task releases it by calling
signal on the same event flag instance.
SignatureRiCOSResult RiCOSEventFlag_wait(
RiCOSEventFlag *const me, int tminms);
Parametersme
The RiCOSEventFlag object.
tmins
Specifies the length of time, in milliseconds,
that the thread should remain blocked. A value of –1 means to wait
indefinitely.
ReturnsThe RiCOSResult object,
as defined in the RiCOS*.h files
ExampleRiCOSResult RiCOSEventFlag_wait(
RiCOSEventFlag * const me, int tminms)
{
if (me == NULL) {return 0 /*WAIT_FAILED*/;}
if (-1 == tminms) {
semTake(me->hEventFlag, WAIT_FOREVER);
}
else {
int ticks = cvrtTmInMStoTicks(tminms);
semTake(me->hEventFlag, ticks);
}
return (RiCOSResult)1;
}