free 方法用于释放锁,这可能会导致底层操作系统重新调度任务。
在除 pSOSystem 外的环境中,此方法是用于实现同一接口的宏。
RiCOSResult RiCOSMutex_free (RiCOSMutex *const me);
me
这是要释放的 RiCOSMutex 对象
RiCOS*.h 文件中定义的 RiCOSResult 对象
RiCOSResult RiCOSMutex_free(RiCOSMutex * const me)
{
if (me == NULL) { return 0; }
if (semGive(me->hMutex)==OK)
return 1; else
return 0;
}