Kaydet (Commit) 57574c2b authored tarafından Stephan Bergmann's avatar Stephan Bergmann

tdf#108005: Problems with progress bar while saving document

...as StatusIndicatorFactory::m_pWakeUp is still non-null after it has already
been used while loading the document.  Regression introduced with
017f2507 "Ensure WakeUpThread is joined before
exit".

(Also, WakeUpThread::stop could take up to 25 msec longer than necessary, as it
failed to set condition_, so would always have waited for WakeUpThread::execute
to finish its next 25 msec condition_.wait call.)

Change-Id: Ic7fe15f1b90f3b8292cd2ceccdc2719a00743d44
Reviewed-on: https://gerrit.libreoffice.org/49718Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 65e14b6c
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
*/ */
#include <algorithm> #include <algorithm>
#include <utility>
#include <helper/statusindicatorfactory.hxx> #include <helper/statusindicatorfactory.hxx>
#include <helper/statusindicator.hxx> #include <helper/statusindicator.hxx>
#include <helper/vclstatusindicator.hxx> #include <helper/vclstatusindicator.hxx>
...@@ -547,7 +548,7 @@ void StatusIndicatorFactory::impl_stopWakeUpThread() ...@@ -547,7 +548,7 @@ void StatusIndicatorFactory::impl_stopWakeUpThread()
rtl::Reference<WakeUpThread> wakeUp; rtl::Reference<WakeUpThread> wakeUp;
{ {
osl::MutexGuard g(m_mutex); osl::MutexGuard g(m_mutex);
wakeUp = m_pWakeUp; std::swap(wakeUp, m_pWakeUp);
} }
if (wakeUp.is()) if (wakeUp.is())
{ {
......
...@@ -53,6 +53,7 @@ void framework::WakeUpThread::stop() { ...@@ -53,6 +53,7 @@ void framework::WakeUpThread::stop() {
osl::MutexGuard g(mutex_); osl::MutexGuard g(mutex_);
terminate_ = true; terminate_ = true;
} }
condition_.set();
join(); join();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment