[Libreoffice-commits] core.git: framework/source

Stephan Bergmann sbergman at redhat.com
Thu Aug 13 06:20:36 PDT 2015


 framework/source/helper/statusindicatorfactory.cxx |   10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

New commits:
commit ded58e062c9e9b8b5f9dc9a18777a1be68359a91
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Aug 13 15:16:38 2015 +0200

    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

diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx
index ca25ff2..44e88f0 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();
     }
 }
 


More information about the Libreoffice-commits mailing list