locking foo ...

Michael Meeks michael.meeks at suse.com
Wed May 15 07:53:01 PDT 2013


	I suspect that the appended is a better fix for
https://gerrit.libreoffice.org/#/c/3894/

	Though clearly the way this interacts with the boilerplate is not
terribly satisfying :-)

	Of course, ideally I'd like to undo -all- the locking, and assume that
in every case we require the solar mutex - except when the GUI thread is
idle - effectively serializing everything on the solar mutex: and then
ease that back in a few, selected cases where threading truly makes
sense but ... ;-)

	Thoughts ?

		Michael.

diff --git a/forms/source/richtext/richtextmodel.cxx b/forms/source/richtext/richtextmodel.cxx
index 15dc234..f549b20 100644
--- a/forms/source/richtext/richtextmodel.cxx
+++ b/forms/source/richtext/richtextmodel.cxx
@@ -67,6 +67,9 @@ namespace frm
         ,m_bSettingEngineText( false                         )
         ,m_aModifyListeners  ( m_aMutex                      )
     {
+        // called from auto-generated factory function via UNO.
+        SolarMutexGuard aGuard;
+
         DBG_CTOR( ORichTextModel, NULL );
         m_nClassId = FormComponentType::TEXTFIELD;
 
@@ -100,6 +103,9 @@ namespace frm
         ,m_bSettingEngineText( false                             )
         ,m_aModifyListeners  ( m_aMutex                          )
     {
+        // called from auto-generated factory function via UNO.
+        SolarMutexGuard aGuard;
+
         DBG_CTOR( ORichTextModel, NULL );
 
         m_aTabStop               = _pOriginal->m_aTabStop;
@@ -208,6 +214,9 @@ namespace frm
     //--------------------------------------------------------------------
     ORichTextModel::~ORichTextModel( )
     {
+        // called via UNO / auto-generated boilerplate
+        SolarMutexGuard aGuard;
+
         if ( !OComponentHelper::rBHelper.bDisposed )
         {
             acquire();


-- 
michael.meeks at suse.com  <><, Pseudo Engineer, itinerant idiot



More information about the LibreOffice mailing list