X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fjob_manager.h;h=cc1c1d28fc20b9250e101c4b7251bf10e9faf2e7;hb=7f203e4df9ca94a44099c26158c6c81b5299567f;hp=d1d33cfc2ce7e7dc3ac4693d579d7309e0ec30e5;hpb=922361469072474da4294a90f1436cd0117cb90f;p=dcpomatic.git diff --git a/src/lib/job_manager.h b/src/lib/job_manager.h index d1d33cfc2..cc1c1d28f 100644 --- a/src/lib/job_manager.h +++ b/src/lib/job_manager.h @@ -23,24 +23,24 @@ #include #include +#include class Job; /** @class JobManager * @brief A simple scheduler for jobs. - * - * JobManager simply keeps a list of pending jobs, and assumes that all the jobs - * are sufficiently CPU intensive that there is no point running them in parallel; - * so jobs are just run one after the other. */ class JobManager { public: - void add (boost::shared_ptr); + boost::shared_ptr add (boost::shared_ptr); void add_after (boost::shared_ptr after, boost::shared_ptr j); std::list > get () const; bool work_to_do () const; + bool errors () const; + + boost::signals2::signal ActiveJobsChanged; static JobManager* instance (); @@ -51,5 +51,7 @@ private: mutable boost::mutex _mutex; std::list > _jobs; + bool _last_active_jobs; + static JobManager* _instance; };