lock

The lock method determines whether the mutex is free and reacts accordingly:

In environments other than pSOSystem, this is a macro that implements the same interface.

Signature
RiCOSResult RiCOSMutex_lock (RiCOSMutex *const me);
Parameters
me

The RiCOSMutex object to lock

Returns

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

Example
RiCOSResult RiCOSMutex_lock(RiCOSMutex * const me)
{
   if (me == NULL) {return 0;}

   if (semTake(me->hMutex, WAIT_FOREVER)==OK) {
      return 1;
   }
   else
      return 0;
}

Feedback