| 1272 | } |
| 1273 | |
| 1274 | void 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 |
no test coverage detected