Improved shutdown reporting git-svn-id: https://svn.microneil.com/svn/SNF4CGP/trunk@27 59e8e3e7-56fa-483b-b4b4-fa6ab0af3dfcmaster
if(Command::QUIT != C.Type) dispatchCommand(C); | if(Command::QUIT != C.Type) dispatchCommand(C); | ||||
else { | else { | ||||
QuitJobNumber = C.Number; | QuitJobNumber = C.Number; | ||||
cout << "* SNF4CGP[" << C.Number << "] Received QUIT, shutting down..." << endl; | |||||
cout.flush(); | |||||
return; | return; | ||||
} | } | ||||
} | } | ||||
shutdownWorkerPool(); | shutdownWorkerPool(); | ||||
shutdownOutput(); | shutdownOutput(); | ||||
shutdownJobPool(); | shutdownJobPool(); | ||||
cout << "* SNF4CGP Shutdown completed." << endl; | |||||
cout << QuitJobNumber << " OK" << endl; | cout << QuitJobNumber << " OK" << endl; | ||||
cout.flush(); | |||||
} | } |
O << CurrentCommand.Number << " REJECTED " << formatAsCGPString(Report) << endl; | O << CurrentCommand.Number << " REJECTED " << formatAsCGPString(Report) << endl; | ||||
} | } | ||||
void Job::finalize() { | |||||
Output.outputJob(*this); | |||||
void Job::finalize() { // Cleanup and report this job. | |||||
closeWriter(); // In case of exception let go of our | |||||
closeReader(); // Reader and Writer now. The rest | |||||
Output.outputJob(*this); // can wait for the output processor. | |||||
} | } | ||||
void Job::doWakeUp() { | void Job::doWakeUp() { |