summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2023-01-21 22:29:51 +0100
committerCarl Hetherington <cth@carlh.net>2023-02-18 00:41:34 +0100
commit59934a54131a1dea15a176b500373ea0ba28873f (patch)
treed2511795b6070e2d89f03be83fce1c147e42e5e5 /src/lib
parent02037166d4384c3a51fcd7100eda6e200198438e (diff)
Early check to see if there's anything to do in set_state().
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/job.cc4
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) {