From: Carl Hetherington Date: Sat, 21 Jan 2023 21:29:51 +0000 (+0100) Subject: Early check to see if there's anything to do in set_state(). X-Git-Tag: v2.16.45~18^2~5 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=9f90d2db337787ebb4da73b909776d5b13a1d520 Early check to see if there's anything to do in set_state(). --- 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) {