From c9cadc1e53abb60a485a8a6de3eeecd54892b4d7 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 5 Nov 2019 00:04:21 +0100 Subject: [PATCH] Yet more waking (in hash computation). --- src/lib/cross.cc | 3 +++ src/lib/cross.h | 2 ++ src/lib/writer.cc | 3 +++ 3 files changed, 8 insertions(+) diff --git a/src/lib/cross.cc b/src/lib/cross.cc index 1b83bad7c..dcd4ddfd8 100644 --- a/src/lib/cross.cc +++ b/src/lib/cross.cc @@ -337,6 +337,7 @@ void Waker::nudge () { #ifdef DCPOMATIC_WINDOWS + boost::mutex::scoped_lock lm (_mutex); SetThreadExecutionState (ES_SYSTEM_REQUIRED); #endif } @@ -344,6 +345,7 @@ Waker::nudge () Waker::Waker () { #ifdef DCPOMATIC_OSX + boost::mutex::scoped_lock lm (_mutex); /* We should use this */ // IOPMAssertionCreateWithName (kIOPMAssertionTypeNoIdleSleep, kIOPMAssertionLevelOn, CFSTR ("Encoding DCP"), &_assertion_id); /* but it's not available on 10.5, so we use this */ @@ -354,6 +356,7 @@ Waker::Waker () Waker::~Waker () { #ifdef DCPOMATIC_OSX + boost::mutex::scoped_lock lm (_mutex); IOPMAssertionRelease (_assertion_id); #endif } diff --git a/src/lib/cross.h b/src/lib/cross.h index 4067631bc..67709463a 100644 --- a/src/lib/cross.h +++ b/src/lib/cross.h @@ -29,6 +29,7 @@ #include #endif #include +#include #ifdef DCPOMATIC_WINDOWS #define WEXITSTATUS(w) (w) @@ -74,6 +75,7 @@ public: void nudge (); private: + boost::mutex _mutex; #ifdef DCPOMATIC_OSX IOPMAssertionID _assertion_id; #endif diff --git a/src/lib/writer.cc b/src/lib/writer.cc index 915376055..48f40334a 100644 --- a/src/lib/writer.cc +++ b/src/lib/writer.cc @@ -780,4 +780,7 @@ Writer::set_digest_progress (Job* job, float progress) } job->set_progress (min_progress); + + Waker waker; + waker.nudge (); } -- 2.30.2