Changeset 5744


Ignore:
Timestamp:
Nov 25, 2017, 1:07:03 PM (17 months ago)
Author:
cameron
Message:

Grep engine bug fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • icGREP/icgrep-devel/icgrep/grep_engine.cpp

    r5740 r5744  
    454454void * GrepEngine::DoGrepThreadMethod() {
    455455    size_t fileIdx;
    456 
     456    bool readyToPrint = false;
     457   
    457458    count_mutex.lock();
    458459    fileIdx = mNextFileToGrep;
     
    482483    count_mutex.lock();
    483484    fileIdx = mNextFileToPrint;
    484     bool readyToPrint = ((fileIdx == 0) || (mFileStatus[fileIdx - 1] == FileStatus::PrintComplete)) && (mFileStatus[fileIdx] == FileStatus::GrepComplete);
    485     if (fileIdx < inputFiles.size() && readyToPrint) {
    486         mFileStatus[fileIdx] = FileStatus::Printing;
    487         mNextFileToPrint++;
     485   
     486    if (fileIdx < inputFiles.size()) {
     487        readyToPrint = ((fileIdx == 0) || (mFileStatus[fileIdx - 1] == FileStatus::PrintComplete)) && (mFileStatus[fileIdx] == FileStatus::GrepComplete);
     488        if (fileIdx < inputFiles.size() && readyToPrint) {
     489            mFileStatus[fileIdx] = FileStatus::Printing;
     490            mNextFileToPrint++;
     491        }
    488492    }
    489493    count_mutex.unlock();
Note: See TracChangeset for help on using the changeset viewer.