cleanup

此方法會在刪除 RiCOSTimer 物件之後,清除記憶體。

簽章
void RiCOSTimer_cleanup (RiCOSTimer * const me);
參數
me

The RiCOSTimer object to clean up after

範例
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;
   }
}

意見回饋