This method waits for a
semaphore token.
SignatureRiCOSResult RiCOSSemaphore_wait(
RiCOSSemaphore *const me, long timeout);
Parametersme
The RiCOSSemaphore object.
timeout
The number of ticks to lock on a semaphore
before timing out. The possible values are < 0 (wait indefinitely);
0 (do not wait); and > 0 (the number of ticks to wait).
For Solaris systems, a value of > 0 means to wait indefinitely.
ReturnsThe RiCOSResult object,
as defined in the RiCOS*.h files
ExampleRiCOSResult RiCOSSemaphore_wait(
RiCOSSemaphore * const me, long timeout)
{
if (!(me && me->m_semId)) return FALSE;
if (timeout < 0) timeout = WAIT_FOREVER;
return (semTake(me->m_semId, timeout) == OK);
}