src/worker.cc
// Memory check work loop. Execute until done, then exhaust pages.
Memory check work loop. Execute until done, then exhaust pages.
Memory check work loop . Execute until done then exhaust pages .
bool CheckThread::Work() {
  struct page_entry pe;
  bool result = true;
  int64 loops = 0;
  logprintf(9, "Log: Starting Check thread %d\n", thread_num_);
  while (true) {
    result = result && sat_->GetValid(&pe);
    if (!result) {
      if (IsReadyToRunNoPause())
        logprintf(0, "Process Error: check_thread failed to pop pages, "
                  "bailing\n");
      else
        result = true;
      break;
    }
    CrcCheckPage(&pe);
    if (IsReadyToRunNoPause())
      result = result && sat_->PutValid(&pe);
    else
      result = result && sat_->PutEmpty(&pe);
    if (!result) {
      logprintf(0, "Process Error: check_thread failed to push pages, "
                "bailing\n");
      break;
    }
    loops++;
  }
  pages_copied_ = loops;
  status_ = result;
  logprintf(9, "Log: Completed %d: Check thread. Status %d, %d pages checked\n",
            thread_num_, status_, pages_copied_);
  return result;
}
bool CheckThread :: Work ( ) { struct page_entry pe ; bool result = true ; int64 loops = 0 ; logprintf ( 9 , " \n " , thread_num_ ) ; while ( true ) { result = result && sat_ -> GetValid ( & pe ) ; if ( ! result ) { if ( IsReadyToRunNoPause ( ) ) logprintf ( 0 , " " " \n " ) ; else result = true ; break ; } CrcCheckPage ( & pe ) ; if ( IsReadyToRunNoPause ( ) ) result = result && sat_ -> PutValid ( & pe ) ; else result = result && sat_ -> PutEmpty ( & pe ) ; if ( ! result ) { logprintf ( 0 , " " " \n " ) ; break ; } loops ++ ; } pages_copied_ = loops ; status_ = result ; logprintf ( 9 , " \n " , thread_num_ , status_ , pages_copied_ ) ; return result ; }
Memory check work loop.
Memory check work loop .
// We want to check all the pages, and // stop when there aren't any left. // Do the result check. // Push pages back on the valid queue if we are still going, // throw them out otherwise.