The wait method blocks the task making the call until some other task releases it by calling signal on the same event flag instance.
RiCOSResult RiCOSEventFlag_wait(
RiCOSEventFlag *const me, int tminms);
me
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.
The RiCOSResult object, as defined in the RiCOS*.h files
RiCOSResult 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;
}