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

Function fxRunPromiseJobs

xs/sources/xsPromise.c:1274–1305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1272}
1273
1274void fxRunPromiseJobs(txMachine* the)
1275{
1276 txSlot* job;
1277 txSlot* slot;
1278 txInteger count;
1279
1280#ifdef mxPromisePrint
1281 fprintf(stderr, "\n# fxRunPromiseJobs\n");
1282#endif
1283 job = mxRunningJobs.value.reference->next = mxPendingJobs.value.reference->next;
1284 mxPendingJobs.value.reference->next = C_NULL;
1285 while (job) {
1286 mxTry(the) {
1287 count = 0;
1288 slot = job->value.reference->next;
1289 while (slot) {
1290 mxPushSlot(slot);
1291 count++;
1292 slot = slot->next;
1293 }
1294 mxRunCount(count - 4);
1295 mxPop();
1296 if (mxDuringJobs.kind == XS_REFERENCE_KIND)
1297 mxDuringJobs.value.reference->next = C_NULL;
1298 }
1299 mxCatch(the) {
1300 fxAbort(the, XS_UNHANDLED_EXCEPTION_EXIT);
1301 }
1302 job = job->next;
1303 }
1304 mxRunningJobs.value.reference->next = C_NULL;
1305}
1306
1307
1308

Callers 14

fxRunLoopFunction · 0.85
mainFunction · 0.85
fxMessageWindowProcFunction · 0.85
doRunPromiseJobsFunction · 0.85
doRunPromiseJobsFunction · 0.85
doRunPromiseJobsFunction · 0.85
doRunPromiseJobsFunction · 0.85
doRunPromiseJobsFunction · 0.85
xsRunPromiseJobs_pendingFunction · 0.85

Calls 1

fxAbortFunction · 0.70

Tested by

no test coverage detected