cleanup

此方法用于在删除 RiCOSTimer 对象后清除内存。

特征符
void RiCOSTimer_cleanup (RiCOSTimer * const me);
参数
me

这是完成操作后要清除的 RiCOSTimer 对象

示例
void RiCOSTimer_cleanup(RiCOSTimer * const me)
{
   if (me == NULL) return;

   if (me->hThread) {
      RiCOSHandle executedOsHandle =
         RiCOSTask_getCurrentTaskHandle();
      /* A handle to this 'thread' */
      RiCOSHandle myOsHandle = me->hThread;
      RiCBoolean onMyThread = ((executedOsHandle ==
         myOsHandle) ? TRUE : FALSE);
      if (onMyThread) {
         RiCOSTask_endMyTask((void*)myOsHandle);
      }
      else {
         RiCOSTask_endOtherTask((void*)myOsHandle);
      }
      me->hThread = 0;
   }
}

反馈