summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2015-08-13 15:16:38 +0200
committerAndras Timar <andras.timar@collabora.com>2015-08-20 14:13:47 +0200
commit3c75a2d5375f44d494a8b1dd04a8d30fa3afb338 (patch)
treed04b25013cd5914d48d1b4da26cfbbce721e315a /framework
parent5d83b0c4c1e19782ebc29e4c9b781fe8f425b8bc (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>
Diffstat (limited to 'framework')
-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();
}
}