此方法會在刪除 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;
}
}