summaryrefslogtreecommitdiff
path: root/src/lib/job.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2012-10-10 12:53:06 +0100
committerCarl Hetherington <cth@carlh.net>2012-10-10 12:53:06 +0100
commit9dd38ef2f05b24ba669acb9805e0914ac227fff2 (patch)
treeaa3b2e4d768764238bb498ca8ad62056cfb95809 /src/lib/job.cc
parenta097506d4867fec47406283caa5b262a21791585 (diff)
Try to not start jobs if a dependant fails.
Diffstat (limited to 'src/lib/job.cc')
-rw-r--r--src/lib/job.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/job.cc b/src/lib/job.cc
index 39ce4173a..d3871bf72 100644
--- a/src/lib/job.cc
+++ b/src/lib/job.cc
@@ -34,10 +34,11 @@ using namespace boost;
* @param o Options.
* @param l A log that we can write to.
*/
-Job::Job (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l)
+Job::Job (shared_ptr<const FilmState> s, shared_ptr<const Options> o, Log* l, shared_ptr<Job> req)
: _fs (s)
, _opt (o)
, _log (l)
+ , _required (req)
, _state (NEW)
, _start_time (0)
, _progress_unknown (false)
@@ -80,6 +81,13 @@ Job::run_wrapper ()
}
}
+bool
+Job::is_new () const
+{
+ boost::mutex::scoped_lock lm (_state_mutex);
+ return _state == NEW;
+}
+
/** @return true if the job is running */
bool
Job::running () const