MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fx_clearTimer

Function fx_clearTimer

xs/tools/xst.c:814–829  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

812}
813
814void fx_clearTimer(txMachine* the)
815{
816 if ((0 == mxArgc) || (XS_REFERENCE_KIND != mxArgv(0)->kind) || (C_NULL == fxGetHostDataIf(the, mxArgv(0))))
817 return;
818 txHostHooks* hooks = fxGetHostHooks(the, mxArgv(0));
819 if (hooks == &gxTimerHooks) {
820 txJob* job = fxGetHostData(the, mxArgv(0));
821 if (job) {
822 fxForget(the, &job->self);
823 fxSetHostData(the, mxArgv(0), NULL);
824 job->the = NULL;
825 txSharedTimer* timer = (txSharedTimer*)(((txByte*)job) - offsetof(txSharedTimer, refcon));
826 fxRescheduleSharedTimer(timer, 0, 0);
827 }
828 }
829}
830
831void fx_destroyTimer(void* data)
832{

Callers

nothing calls this directly

Calls 6

fxGetHostDataIfFunction · 0.85
fxGetHostHooksFunction · 0.85
fxGetHostDataFunction · 0.85
fxForgetFunction · 0.85
fxSetHostDataFunction · 0.85
fxRescheduleSharedTimerFunction · 0.85

Tested by

no test coverage detected