- if (changed) {
- priority_changed ();
- }
-}
-
-
-void
-JobManager::priority_changed ()
-{
- {
- boost::mutex::scoped_lock lm (_mutex);
-
- bool first = true;
- for (auto i: _jobs) {
- if (first) {
- if (i->is_new ()) {
- i->start ();
- } else if (i->paused_by_priority ()) {
- i->resume ();
- }
- first = false;
- } else {
- if (i->running ()) {
- i->pause_by_priority ();
- }
- }
- }
- }
-
- emit (boost::bind(boost::ref(JobsReordered)));