Don't run more than one job at once.
authorCarl Hetherington <cth@carlh.net>
Wed, 10 Oct 2012 14:47:22 +0000 (15:47 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 10 Oct 2012 14:47:22 +0000 (15:47 +0100)
src/lib/job_manager.cc

index 562c887de9b57479c75f702928ac2ae6aec5d313..2db91a177cc08c194644e7b35efc7095e577cddd 100644 (file)
@@ -95,6 +95,11 @@ JobManager::scheduler ()
                {
                        boost::mutex::scoped_lock lm (_mutex);
                        for (list<shared_ptr<Job> >::iterator i = _jobs.begin(); i != _jobs.end(); ++i) {
+                               if ((*i)->running ()) {
+                                       /* Something is already happening */
+                                       break;
+                               }
+                               
                                if ((*i)->is_new()) {
                                        shared_ptr<Job> r = (*i)->required ();
                                        if (!r || r->finished_ok ()) {