diff options
| author | Carl Hetherington <cth@carlh.net> | 2023-01-21 22:29:51 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2023-02-27 14:47:25 +0100 |
| commit | 9f90d2db337787ebb4da73b909776d5b13a1d520 (patch) | |
| tree | cccfe5ff095aebcdef26242b30f0c414a97a8b37 | |
| parent | 5293bcb837f4472141ff680b1cf05a42958e7217 (diff) | |
Early check to see if there's anything to do in set_state().
| -rw-r--r-- | src/lib/job.cc | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/lib/job.cc b/src/lib/job.cc index 6ec154c34..53527d265 100644 --- a/src/lib/job.cc +++ b/src/lib/job.cc @@ -344,6 +344,10 @@ Job::set_state (State s) { boost::mutex::scoped_lock lm (_state_mutex); + if (_state == s) { + return; + } + _state = s; if (_state == FINISHED_OK || _state == FINISHED_ERROR || _state == FINISHED_CANCELLED) { |
