init

This method initializes the RiCOSSemaphore.

Signature
RiCBoolean RiCOSSemaphore_init (
   RiCOSSemaphore *const me, unsigned long semFlags,
   unsigned long initialCount, unsigned long maxCount,
   const char *const name);
Parameters
me

The RiCOSSemaphore object to initialize

semFlags

The adapter-specific creation flags

initialCount

The initial number of tokens available in the semaphore

maxCount

The maximum number of tokens available in the semaphore

name

The unique name of the semaphore

Returns

The method returns RiCTRUE if successful.

Example
RiCBoolean RiCOSSemaphore_init(RiCOSSemaphore * const me,
   unsigned long semFlags, unsigned long initialCount,
   unsigned long maxCount, const char * const name)
{
   if (me == NULL) return RiCFALSE;

   me->m_semId = NULL;
   me->m_semId = semCCreate((int)semFlags, 
      (int)initialCount);
   return (me->m_semId != NULL);
}

Feedback