Browse Source

Bug fix: doFile now closes message reader immediately after scan so that the file is not open when CGP resumes processing.

Cleanup: Clarified code in output processor to avoid confusion about the (J = CompletedJobs.take()) assignment while waiting for a 0.

git-svn-id: https://svn.microneil.com/svn/SNF4CGP/trunk@55 59e8e3e7-56fa-483b-b4b4-fa6ab0af3dfc
master
madscientist 11 years ago
parent
commit
5279129279
2 changed files with 2 additions and 2 deletions
  1. 1
    1
      SNF4CGP/JobPool.cpp
  2. 1
    1
      SNF4CGP/OutputProcessor.cpp

+ 1
- 1
SNF4CGP/JobPool.cpp View File

void Job::doFILE() { void Job::doFILE() {
doInitialRead(); doInitialRead();
doScan(); doScan();
doAction();
closeReader(); closeReader();
doAction();
} }
RuntimeCheck CheckMessageReaderIsValid("Job::Reader() Check(0 != Reader_)"); RuntimeCheck CheckMessageReaderIsValid("Job::Reader() Check(0 != Reader_)");

+ 1
- 1
SNF4CGP/OutputProcessor.cpp View File

void OutputProcessor::myTask() { // This is how we do it. void OutputProcessor::myTask() { // This is how we do it.
Job* J = 0; // Pull Job pointers from the queue. Job* J = 0; // Pull Job pointers from the queue.
CurrentThreadState(WaitingForJobs); CurrentThreadState(WaitingForJobs);
while(J = CompletedJobs.take()) { // Process every job until we get
while(0 != (J = CompletedJobs.take())) { // Process every job until we get
handleJob(*J); // a 0 pointer. Then we're done. handleJob(*J); // a 0 pointer. Then we're done.
CurrentThreadState(WaitingForJobs); CurrentThreadState(WaitingForJobs);
} }

Loading…
Cancel
Save