Changeset 4156


Ignore:
Timestamp:
Mar 12, 2022, 6:34:26 AM (7 months ago)
Author:
Peter
Message:

refs #980. Test was inci=omplete in r4155. Fixed here.

Location:
branches/0.19-stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/0.19-stable/test/scheduler8.cc

    r4155 r4156  
    6969  task.push_back(boost::shared_ptr<Sleeper>(new Sleeper(1, result)));
    7070  task.push_back(boost::shared_ptr<Sleeper>(new Sleeper(1, result)));
     71  for (auto job : task)
     72    scheduler.submit(job);
    7173  if (true) {
    7274    scheduler.interrupt();
  • branches/0.19-stable/yat/utility/Scheduler.cc

    r4155 r4156  
    493493  void Scheduler::JobHandler::interrupt_workers(void)
    494494  {
    495     data_->queue().clear();
     495    JobPtr tmp;
     496    // We would like to clear the queue and reduce running_jobs with
     497    // the reduced size, but ATM there is no way to lock the queue to
     498    // ensure an Worker is not modifying it between we assess the size
     499    // and clear it.
     500    while (data_->queue().try_pop(tmp))
     501      data_->running_jobs().decrement();
     502
    496503    kill_workers();
    497504  }
Note: See TracChangeset for help on using the changeset viewer.