diff options
| author | Carl Hetherington <cth@carlh.net> | 2018-11-15 23:41:22 +0000 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2018-11-22 23:26:18 +0000 |
| commit | 63bce67bd548f4aff98e2a1963e1fd77a6412a15 (patch) | |
| tree | 44cb9fddd35817db51f79685a67b50050cddd56c /src/lib/job_manager.h | |
| parent | 620b7761a33d2e3641cd911bfe58e0fbb928c888 (diff) | |
Speed up content discovery:
1. add all discovery jobs immediately rather than waiting for
each one to finish (by polling) before starting the next.
2. replace polling with a condition in JobManager.
Diffstat (limited to 'src/lib/job_manager.h')
| -rw-r--r-- | src/lib/job_manager.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/job_manager.h b/src/lib/job_manager.h index aafb7aa67..e0b72994d 100644 --- a/src/lib/job_manager.h +++ b/src/lib/job_manager.h @@ -26,6 +26,7 @@ #include <boost/thread/mutex.hpp> #include <boost/thread.hpp> #include <boost/signals2.hpp> +#include <boost/thread/condition.hpp> #include <list> class Job; @@ -78,10 +79,13 @@ private: void scheduler (); void start (); void priority_changed (); + void job_finished (); mutable boost::mutex _mutex; + boost::condition _empty_condition; /** List of jobs in the order that they will be executed */ std::list<boost::shared_ptr<Job> > _jobs; + std::list<boost::signals2::connection> _connections; bool _terminate; bool _paused; boost::shared_ptr<Job> _paused_job; |
