Skip to content

Commit

Permalink
Scheduler: Set running state for multithreaded schedulers
Browse files Browse the repository at this point in the history
Make sure a started scheduler can be stopped afterwards, by setting
the expected RUNNING state.

Part of issue #217.
  • Loading branch information
frankosterfeld authored and RalphSteinhagen committed Jan 17, 2024
1 parent 72fcd5b commit 7d22e96
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions core/include/gnuradio-4.0/Scheduler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ class Simple : public SchedulerBase<TProfiler> {
this->_state = lifecycle::State::ERROR;
}
} else if (executionPolicy == ExecutionPolicy::multiThreaded) {
this->_state = lifecycle::State::RUNNING;
this->runOnPool(this->_job_lists, [this](auto &job) { return this->workOnce(job); });
} else {
throw std::invalid_argument("Unknown execution Policy");
Expand Down Expand Up @@ -446,6 +447,7 @@ class BreadthFirst : public SchedulerBase<TProfiler> {
}
}
} else if (executionPolicy == multiThreaded) {
this->_state = lifecycle::State::RUNNING;
this->runOnPool(this->_job_lists, [this](auto &job) { return this->workOnce(job); });
} else {
throw std::invalid_argument("Unknown execution Policy");
Expand Down

0 comments on commit 7d22e96

Please sign in to comment.