- while (xbt_dynar_length(bg_jobs)) {
- xbt_dynar_pop(bg_jobs, &rctx);
- if (rctx != initiator) {
- INFO2("Kill <%s> because <%s> failed", rctx->filepos,
- initiator->filepos);
- xbt_os_mutex_acquire(rctx->interruption);
- rctx->interrupted = 1;
- xbt_os_mutex_release(rctx->interruption);
- if (!rctx->reader_done) {
- kill(rctx->pid, SIGTERM);
- usleep(100);
- kill(rctx->pid, SIGKILL);
- }
- }
+ xbt_dynar_foreach(bg_jobs, cursor, job) {
+ rctx_armageddon_kill_one(initiator, filepos, job);