toolkit/inc/awt/vclxpointer.hxx |    8 ++++++--
 vcl/source/app/session.cxx      |    9 +++++++--
 2 files changed, 13 insertions(+), 4 deletions(-)

New commits:
commit fa58e872794f23a84e6a741f0d3074bca9f93c19
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Oct 3 15:56:43 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Oct 3 18:43:57 2024 +0200

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

diff --git a/vcl/source/app/session.cxx b/vcl/source/app/session.cxx
index b742fc948ba0..2ec3bbc5c7d6 100644
--- a/vcl/source/app/session.cxx
+++ b/vcl/source/app/session.cxx
@@ -294,16 +294,21 @@ void SAL_CALL VCLSession::queryInteraction( const 
css::uno::Reference<XSessionMa
 
     SAL_INFO("vcl.se.debug", "  m_bInteractionGranted = " << 
(m_bInteractionGranted ? "true" : "false") <<
                              ", m_bInteractionRequested = "<< 
(m_bInteractionRequested ? "true" : "false"));
+
+    std::unique_lock aGuard( m_aMutex );
+
     if( m_bInteractionGranted )
     {
-        if( m_bInteractionDone )
+        bool bInteractionDone = m_bInteractionDone;
+        aGuard.unlock();
+
+        if( bInteractionDone )
             xListener->approveInteraction( false );
         else
             xListener->approveInteraction( true );
         return;
     }
 
-    std::unique_lock aGuard( m_aMutex );
     if( ! m_bInteractionRequested )
     {
         if (m_xSession)
commit 95faca7cf8e8bf09b30c3ee9f4d6b5e81a660c2f
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Oct 3 15:52:10 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Oct 3 18:43:47 2024 +0200

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

diff --git a/toolkit/inc/awt/vclxpointer.hxx b/toolkit/inc/awt/vclxpointer.hxx
index 103031926919..6a4c21b1d611 100644
--- a/toolkit/inc/awt/vclxpointer.hxx
+++ b/toolkit/inc/awt/vclxpointer.hxx
@@ -34,14 +34,18 @@
 class VCLXPointer final : public cppu::WeakImplHelper<
     css::awt::XPointer, css::lang::XServiceInfo>
 {
-    std::mutex    maMutex;
+    mutable std::mutex maMutex;
     PointerStyle    maPointer;
 
 public:
     VCLXPointer();
     virtual ~VCLXPointer() override;
 
-    PointerStyle GetPointer() const { return maPointer; }
+    PointerStyle GetPointer() const
+    {
+        std::scoped_lock aGuard( maMutex );
+        return maPointer;
+    }
 
     // css::awt::XPointer
     void SAL_CALL setType( sal_Int32 nType ) override;

Reply via email to