ucb/source/ucp/tdoc/tdoc_stgelems.hxx         |    9 ++++++---
 ucbhelper/source/client/content.cxx           |    9 +++------
 ucbhelper/source/provider/resultsethelper.cxx |   12 ++++++++----
 3 files changed, 17 insertions(+), 13 deletions(-)

New commits:
commit e376719201d8300cff467eb8098aa932723413b4
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Tue Oct 1 19:25:34 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Oct 2 09:38:07 2024 +0200

    cid#1557069 Data race condition
    
    Change-Id: Ic4a20cb5682c575affa9933a55d677a8048c4c2f
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174360
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx 
b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx
index 40dd7f723705..6562ab7ffa47 100644
--- a/ucb/source/ucp/tdoc/tdoc_stgelems.hxx
+++ b/ucb/source/ucp/tdoc/tdoc_stgelems.hxx
@@ -48,9 +48,12 @@ public:
 
     bool isParentARootStorage() const
     { return m_bParentIsRootStorage; }
-    const css::uno::Reference< css::embed::XStorage >&
+    css::uno::Reference< css::embed::XStorage >
     getParentStorage() const
-    { return m_xParentStorage; }
+    {
+        std::scoped_lock aGuard( m_aMutex );
+        return m_xParentStorage;
+    }
     void clearParentStorage()
     {
         std::scoped_lock aGuard( m_aMutex );
@@ -58,7 +61,7 @@ public:
     }
 
 private:
-    std::mutex m_aMutex;
+    mutable std::mutex m_aMutex;
     css::uno::Reference< css::embed::XStorage > m_xParentStorage;
     bool                                  m_bParentIsRootStorage;
 };
commit 3b60abdc948f3101d2107bd515f4ca31b041bd04
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Tue Oct 1 19:23:34 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Oct 2 09:38:00 2024 +0200

    cid#1608390 Data race condition
    
    Change-Id: I98a8addad50888e5969fce5bf47d67f96b06ecf0
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174359
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/ucbhelper/source/client/content.cxx 
b/ucbhelper/source/client/content.cxx
index 68db5fce9817..b3f2fe2e1ff4 100644
--- a/ucbhelper/source/client/content.cxx
+++ b/ucbhelper/source/client/content.cxx
@@ -1241,13 +1241,10 @@ const Reference< XContent > & 
Content_Impl::getContent_NoLock()
 
 Reference< XCommandProcessor > Content_Impl::getCommandProcessor()
 {
-    if ( !m_xCommandProcessor.is() )
-    {
-        std::unique_lock aGuard( m_aMutex );
+    std::unique_lock aGuard( m_aMutex );
 
-        if ( !m_xCommandProcessor.is() )
-            m_xCommandProcessor.set( getContent_NoLock(), UNO_QUERY );
-    }
+    if ( !m_xCommandProcessor.is() )
+        m_xCommandProcessor.set( getContent_NoLock(), UNO_QUERY );
 
     return m_xCommandProcessor;
 }
commit 9ea9c6f0fc5e08167906b22817ad03c3fd072e62
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Tue Oct 1 19:19:23 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Oct 2 09:37:52 2024 +0200

    cid#1606901 Data race condition
    
    Change-Id: Id1d8f0895021719670c5419ab464c247ae3bf29c
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174358
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/ucbhelper/source/provider/resultsethelper.cxx 
b/ucbhelper/source/provider/resultsethelper.cxx
index f4e1154f0bce..80a9caeed97a 100644
--- a/ucbhelper/source/provider/resultsethelper.cxx
+++ b/ucbhelper/source/provider/resultsethelper.cxx
@@ -185,11 +185,15 @@ sal_Int16 SAL_CALL ResultSetImplHelper::getCapabilities()
 void SAL_CALL ResultSetImplHelper::connectToCache(
         const uno::Reference< css::ucb::XDynamicResultSet > & xCache )
 {
-    if ( m_xListener.is() )
-        throw css::ucb::ListenerAlreadySetException();
+    {
+        std::unique_lock aGuard( m_aMutex );
 
-    if ( m_bStatic )
-        throw css::ucb::ListenerAlreadySetException();
+        if ( m_xListener.is() )
+            throw css::ucb::ListenerAlreadySetException();
+
+        if ( m_bStatic )
+            throw css::ucb::ListenerAlreadySetException();
+    }
 
     uno::Reference< css::ucb::XSourceInitialization > xTarget( xCache, 
uno::UNO_QUERY );
     if ( xTarget.is() )

Reply via email to