batches. Waiting at other times is problematic, for instance if were
are waiting after a job starts from a pending state (job submitted for a
future time), on a busy server, sometimes runScheduler() can actuall run
between the time we put the job on the runq in ctrlJobDone(), and the
FaxRequest req is destroyed when unwonding the call stack back to
runJob() (called by the job ttsHandler.timerExpired()).
Sys::close(pfd[1]);
}
}
- if (jobCtrlWait)
- {
- logError("WAITING FOR JobControl to finish");
- while (job.isEmpty() )
- Dispatcher::instance().dispatch();
- }
} else {
ctrlJobDone(job, 0);
}
sleepiter.job().state = FaxRequest::state_ready;
sleepiter.job().remove();
setReadyToRun(sleepiter.job());
+ if (jobCtrlWait)
+ {
+ logError("WAITING FOR JobControl to finish");
+ while (job.isEmpty() )
+ Dispatcher::instance().dispatch();
+ }
}
Job* bjob = &job; // Last batched Job