wait

The wait method blocks the task making the call until some other task releases it by calling signal on the same event flag instance.

Signature
RiCOSResult RiCOSEventFlag_wait(
   RiCOSEventFlag *const me, int tminms);
Parameters
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.

Returns

The RiCOSResult object, as defined in the RiCOS*.h files

Example
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;
}

Feedback