framework/source/services/autorecovery.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 1c3e88a4ffd927d4dda8bb9e0d05cddc6cd685c0
Author: Stephan Bergmann <sberg...@redhat.com>
Date:   Tue Nov 22 15:59:01 2016 +0100

    Timer::Start must be called with SolarMutex locked
    
    cf. DBG_TESTSOLARMUTEX added to Scheduler::Start in
    c00d8271ba443c4f0acf657c226eea4824597f95 "vcl: assert solar mutex is held 
for
    various timer / scheduler ops."
    
    So cover operations on AutoRecovery::m_aTimer with SolarMutexGuard instead 
of
    AutoRecovery's own mutex.  Is it safe to split guarding like that here?
    Hopefully.  Would it be better to exclusively use SolarMutexGuard?  Maybe.
    
    The DBG_TESTSOLARMUTEX assert fired at least on macOS when opening some .odb
    file:
    
    > frame #19: 0x00007fffc80e5893 libsystem_c.dylib`__assert_rtn + 320
    > frame #20: 0x000000010f5e4dae libvcllo.dylib`ImplDbgTestSolarMutex() + 
110 at vcl/source/app/dbggui.cxx:47
    > frame #21: 0x000000010e6a5d62 libtllo.dylib`DbgTestSolarMutex() + 130 at 
tools/source/debug/debug.cxx:74
    > frame #22: 0x000000010f5eeb3a 
libvcllo.dylib`Scheduler::Start(this=0x00000001489233a8) + 58 at 
vcl/source/app/scheduler.cxx:287
    > frame #23: 0x000000010f62f03f 
libvcllo.dylib`Timer::Start(this=0x00000001489233a8) + 31 at 
vcl/source/app/timer.cxx:93
    > frame #24: 0x00000001481b7483 libfwklo.dylib`(anonymous 
namespace)::AutoRecovery::implts_updateTimer(this=0x00000001489232a0) + 259 at 
framework/source/services/autorecovery.cxx:2274
    > frame #25: 0x00000001481b3009 libfwklo.dylib`(anonymous 
namespace)::AutoRecovery::changesOccurred(this=0x00000001489232a0, 
aEvent=0x00007f92d87d0ec8) + 649 at 
framework/source/services/autorecovery.cxx:1678
    > frame #26: 0x000000014807e04b 
libfwklo.dylib`framework::WeakChangesListener::changesOccurred(this=0x0000000148c42488,
 rEvent=0x00007f92d87d0ec8) + 155 at framework/inc/helper/mischelper.hxx:222
    > frame #27: 0x000000011c13f29e 
libconfigmgrlo.dylib`configmgr::Broadcaster::send(this=0x00007000082f9e70) + 
5694 at configmgr/source/broadcaster.cxx:187
    > frame #28: 0x000000011c0fd9bc 
libconfigmgrlo.dylib`configmgr::Access::insertByName(this=0x0000000148c118e0, 
aName=0x00007000082fa258, aElement=0x00007000082fa118) + 3196 at 
configmgr/source/access.cxx:1232
    > frame #29: 0x00000001481bdd23 libfwklo.dylib`(anonymous 
namespace)::AutoRecovery::implts_flushConfigItem(this=0x00000001489232a0, 
rInfo=0x00007000082fa600, bRemoveIt=false)::AutoRecovery::TDocumentInfo const&, 
bool) + 2483 at framework/source/services/autorecovery.cxx:2092
    > frame #30: 0x00000001481bb09d libfwklo.dylib`(anonymous 
namespace)::AutoRecovery::implts_registerDocument(this=0x00000001489232a0, 
xDocument=0x00007000082fa790) + 3597 at 
framework/source/services/autorecovery.cxx:2519
    > frame #31: 0x00000001481b2a35 libfwklo.dylib`(anonymous 
namespace)::AutoRecovery::documentEventOccured(this=0x00000001489232a0, 
aEvent=0x00007f92db3d8620) + 165 at 
framework/source/services/autorecovery.cxx:1571
    > frame #32: 0x00000001481d025b 
libfwklo.dylib`framework::WeakDocumentEventListener::documentEventOccured(this=0x0000000148c42548,
 rEvent=0x00007f92db3d8620) + 155 at framework/inc/helper/mischelper.hxx:258
    > frame #33: 0x0000000109fca69e 
libsfxlo.dylib`comphelper::OInterfaceContainerHelper2::NotifySingleListener<com::sun::star::document::XDocumentEventListener,
 com::sun::star::document::DocumentEvent>::operator(this=0x00007000082fa910, 
listener=0x00007000082fa880)(com::sun::star::uno::Reference<com::sun::star::document::XDocumentEventListener>
 const&) const + 126 at include/comphelper/interfacecontainer2.hxx:272
    > frame #34: 0x0000000109fca4a3 libsfxlo.dylib`void 
comphelper::OInterfaceContainerHelper2::forEach<com::sun::star::document::XDocumentEventListener,
 
comphelper::OInterfaceContainerHelper2::NotifySingleListener<com::sun::star::document::XDocumentEventListener,
 com::sun::star::document::DocumentEvent> >(this=0x00000001489186b8, 
func=0x00007000082fa910) + 163 at include/comphelper/interfacecontainer2.hxx:285
    > frame #35: 0x0000000109fca0de libsfxlo.dylib`void 
comphelper::OInterfaceContainerHelper2::notifyEach<com::sun::star::document::XDocumentEventListener,
 com::sun::star::document::DocumentEvent>(this=0x00000001489186b8, 
NotificationMethod=21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, 
Event=0x00007f92db3d8620)(com::sun::star::document::DocumentEvent const&), 
com::sun::star::document::DocumentEvent const&) + 126 at 
include/comphelper/interfacecontainer2.hxx:298
    > frame #36: 0x0000000109fc9f08 libsfxlo.dylib`(anonymous 
namespace)::SfxGlobalEvents_Impl::implts_notifyListener(this=0x0000000148918628,
 aEvent=0x00007f92db3d8620) + 168 at sfx2/source/notify/globalevents.cxx:438
    > frame #37: 0x0000000109fc6874 libsfxlo.dylib`(anonymous 
namespace)::SfxGlobalEvents_Impl::documentEventOccured(this=0x0000000148918628, 
Event=0x00007f92db3d8620) + 132 at sfx2/source/notify/globalevents.cxx:243
    > frame #38: 0x000000014957597e 
libdbalo.dylib`comphelper::OInterfaceContainerHelper2::NotifySingleListener<com::sun::star::document::XDocumentEventListener,
 com::sun::star::document::DocumentEvent>::operator(this=0x00007000082fab30, 
listener=0x00007000082faaa0)(com::sun::star::uno::Reference<com::sun::star::document::XDocumentEventListener>
 const&) const + 126 at include/comphelper/interfacecontainer2.hxx:272
    > frame #39: 0x0000000149575753 libdbalo.dylib`void 
comphelper::OInterfaceContainerHelper2::forEach<com::sun::star::document::XDocumentEventListener,
 
comphelper::OInterfaceContainerHelper2::NotifySingleListener<com::sun::star::document::XDocumentEventListener,
 com::sun::star::document::DocumentEvent> >(this=0x00007f92db0965f0, 
func=0x00007000082fab30) + 163 at include/comphelper/interfacecontainer2.hxx:285
    > frame #40: 0x000000014957407e libdbalo.dylib`void 
comphelper::OInterfaceContainerHelper2::notifyEach<com::sun::star::document::XDocumentEventListener,
 com::sun::star::document::DocumentEvent>(this=0x00007f92db0965f0, 
NotificationMethod=21 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00, 
Event=0x00007f92db3d8620)(com::sun::star::document::DocumentEvent const&), 
com::sun::star::document::DocumentEvent const&) + 126 at 
include/comphelper/interfacecontainer2.hxx:298
    > frame #41: 0x0000000149573dfb 
libdbalo.dylib`dbaccess::DocumentEventNotifier_Impl::impl_notifyEvent_nothrow(this=0x00007f92db0965a0,
 _rEvent=0x00007f92db3d8620) + 379 at 
dbaccess/source/core/dataaccess/documenteventnotifier.cxx:196
    > frame #42: 0x0000000149574580 
libdbalo.dylib`dbaccess::DocumentEventNotifier_Impl::processEvent(this=0x00007f92db0965a0,
 _rEvent=0x00007f92db3d8610) + 224 at 
dbaccess/source/core/dataaccess/documenteventnotifier.cxx:229
    > frame #43: 0x000000010832ba30 
libcomphelper.dylib`comphelper::AsyncEventNotifierBase::execute(this=0x000000014df32dd0)
 + 1184 at comphelper/source/misc/asyncnotification.cxx:163
    > frame #44: 0x000000010832e28a 
libcomphelper.dylib`comphelper::AsyncEventNotifierAutoJoin::run(this=0x000000014df32dd0)
 + 90 at comphelper/source/misc/asyncnotification.cxx:263
    > frame #45: 0x000000010832f23e 
libcomphelper.dylib`::threadFunc(param=0x000000014df32dd0) + 30 at 
include/osl/thread.hxx:185
    > frame #46: 0x0000000107e9bc27 
libuno_sal.dylib.3`osl_thread_start_Impl(pData=0x00007f92db351d30) + 295 at 
sal/osl/unx/thread.cxx:240
    > frame #47: 0x00007fffc82a1aab libsystem_pthread.dylib`_pthread_body + 180
    > frame #48: 0x00007fffc82a19f7 libsystem_pthread.dylib`_pthread_start + 286
    > frame #49: 0x00007fffc82a1221 libsystem_pthread.dylib`thread_start + 13
    
    Change-Id: I58fe8d61bfc491fa635b75d471a221bbb55c0f6e

diff --git a/framework/source/services/autorecovery.cxx 
b/framework/source/services/autorecovery.cxx
index dec1ee8..6d0e064 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -2249,6 +2249,7 @@ void AutoRecovery::implts_updateTimer()
 {
     implts_stopTimer();
 
+    sal_Int32 nMilliSeconds = 0;
     /* SAFE */ {
     osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
 
@@ -2258,7 +2259,6 @@ void AutoRecovery::implts_updateTimer()
        )
         return;
 
-    sal_Int32 nMilliSeconds = 0;
     if (m_eTimerType == AutoRecovery::E_NORMAL_AUTOSAVE_INTERVALL)
     {
         nMilliSeconds = (m_nAutoSaveTimeIntervall*60000); // [min] => 60.000 ms
@@ -2270,15 +2270,16 @@ void AutoRecovery::implts_updateTimer()
     else if (m_eTimerType == AutoRecovery::E_POLL_TILL_AUTOSAVE_IS_ALLOWED)
         nMilliSeconds = 300; // there is a minimum time frame, where the user 
can lose some key input data!
 
+    } /* SAFE */
+
+    SolarMutexGuard g;
     m_aTimer.SetTimeout(nMilliSeconds);
     m_aTimer.Start();
-
-    } /* SAFE */
 }
 
 void AutoRecovery::implts_stopTimer()
 {
-    osl::MutexGuard g(cppu::WeakComponentImplHelperBase::rBHelper.rMutex);
+    SolarMutexGuard g;
 
     if (!m_aTimer.IsActive())
         return;
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to