summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2018-02-14 13:21:40 +0100
committerMichael Stahl <mstahl@redhat.com>2018-02-15 21:46:55 +0100
commit56b96f3cc1f03313afade4f642861efb76d0bb54 (patch)
treeaf64e6bf94e51d2cdc6b0b9e8416d6db3565201d /framework
parent8c9d3e283e290fa241f9680da80a33dcc63751d5 (diff)
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 017f250764ec7b4ecb82ac19f5b3f68cadf1bf56 "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/49718 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com> (cherry picked from commit 57574c2bcc60d37620288c403267c34d960f5863) Reviewed-on: https://gerrit.libreoffice.org/49780 Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/helper/statusindicatorfactory.cxx3
-rw-r--r--framework/source/helper/wakeupthread.cxx1
2 files changed, 3 insertions, 1 deletions
diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx
index 2d5563d1213c..e3753e2f3ca7 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -18,6 +18,7 @@
*/
#include <algorithm>
+#include <utility>
#include <helper/statusindicatorfactory.hxx>
#include <helper/statusindicator.hxx>
#include <helper/vclstatusindicator.hxx>
@@ -547,7 +548,7 @@ void StatusIndicatorFactory::impl_stopWakeUpThread()
rtl::Reference<WakeUpThread> wakeUp;
{
osl::MutexGuard g(m_mutex);
- wakeUp = m_pWakeUp;
+ std::swap(wakeUp, m_pWakeUp);
}
if (wakeUp.is())
{
diff --git a/framework/source/helper/wakeupthread.cxx b/framework/source/helper/wakeupthread.cxx
index b13621225d21..503f6707a010 100644
--- a/framework/source/helper/wakeupthread.cxx
+++ b/framework/source/helper/wakeupthread.cxx
@@ -53,6 +53,7 @@ void framework::WakeUpThread::stop() {
osl::MutexGuard g(mutex_);
terminate_ = true;
}
+ condition_.set();
join();
}