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

Function fx_callbackTimer

xs/tools/xst.c:779–812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

777};
778
779void fx_callbackTimer(txSharedTimer* timer, void* refcon, txInteger refconSize)
780{
781 txJob* job = (txJob*)refcon;
782 txMachine* the = job->the;
783 if (the) {
784 fxBeginHost(the);
785 mxTry(the) {
786 mxPushUndefined();
787 mxPush(job->function);
788 mxCall();
789 mxPush(job->argument);
790 mxRunCount(1);
791 mxPop();
792 }
793 mxCatch(the) {
794 *((txSlot*)the->rejection) = mxException;
795 timer->interval = 0;
796 }
797 if (job->the) {
798 if (timer->interval == 0) {
799 fxAccess(the, &job->self);
800 *mxResult = the->scratch;
801 fxForget(the, &job->self);
802 fxSetHostData(the, mxResult, NULL);
803 job->the = NULL;
804 }
805 }
806 else
807 timer->interval = 0;
808 fxEndHost(the);
809 }
810 else
811 timer->interval = 0;
812}
813
814void fx_clearTimer(txMachine* the)
815{

Callers

nothing calls this directly

Calls 5

fxBeginHostFunction · 0.85
fxAccessFunction · 0.85
fxForgetFunction · 0.85
fxSetHostDataFunction · 0.85
fxEndHostFunction · 0.85

Tested by

no test coverage detected