summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-08-13 15:16:38 +0200
committerCaolán McNamara <caolanm@redhat.com>2015-08-13 16:27:16 +0000
commitbb7800ca04a81093ebeb37fd2ec4982268c1ea6c (patch)
tree63bae34e13a80877ec60389b57f0e8ef37f99535
parent1be1d904188f83f1a996f4a741c39f0e6c14522e (diff)
Related tdf#93404: Fix deadlock when joining WakeUpThread
...after 54f10a9654b617c4c993044e52e7bd40d0151c53 "tdf#93404: Forgot to launch WakeUpThread," when the WakeUpThread blocks on locking StatusIndicatorFactory::m_mutex in StatusIndicatorFactory::update() while the joining thread blocks on StatusIndicatorFactory::impl_stopWakeUpThread() -> WakeUpThread::stop() -> Thread::join(). Change-Id: I3480014b1f522901064ea9b71ffa2ebf5d74fef5 (cherry picked from commit ded58e062c9e9b8b5f9dc9a18777a1be68359a91) Reviewed-on: https://gerrit.libreoffice.org/17709 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--framework/source/helper/statusindicatorfactory.cxx10
1 files changed, 7 insertions, 3 deletions
diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx
index a0a4fdee636e..854972315585 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -550,10 +550,14 @@ void StatusIndicatorFactory::impl_startWakeUpThread()
void StatusIndicatorFactory::impl_stopWakeUpThread()
{
- osl::MutexGuard g(m_mutex);
- if (m_pWakeUp.is())
+ rtl::Reference<WakeUpThread> wakeUp;
+ {
+ osl::MutexGuard g(m_mutex);
+ wakeUp = m_pWakeUp;
+ }
+ if (wakeUp.is())
{
- m_pWakeUp->stop();
+ wakeUp->stop();
}
}