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.
RiCOSResult RiCOSMutex_lock (RiCOSMutex *const me);
me
The RiCOSMutex object to lock
The RiCOSResult object, as defined in the RiCOS*.h files
RiCOSResult RiCOSMutex_lock(RiCOSMutex * const me)
{
if (me == NULL) {return 0;}
if (semTake(me->hMutex, WAIT_FOREVER)==OK) {
return 1;
}
else
return 0;
}