ucb/source/sorter/sortdynres.cxx |   11 +++++++----
 ucb/source/sorter/sortresult.cxx |    5 +++++
 2 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 2857c0b9cd096a83c7d0de927116dac1fd7c0b09
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Tue Oct 1 20:11:56 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Oct 2 09:38:43 2024 +0200

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

diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index b4eefd920cf3..cacdc9f52617 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -168,11 +168,14 @@ SortedDynamicResultSet::setListener( const Reference< 
XDynamicResultSetListener
 void SAL_CALL
 SortedDynamicResultSet::connectToCache( const Reference< XDynamicResultSet > & 
xCache )
 {
-    if( mxListener.is() )
-        throw ListenerAlreadySetException();
+    {
+        std::unique_lock aGuard( maMutex );
+        if( mxListener.is() )
+            throw ListenerAlreadySetException();
 
-    if( mbStatic )
-        throw ListenerAlreadySetException();
+        if( mbStatic )
+            throw ListenerAlreadySetException();
+    }
 
     Reference< XSourceInitialization > xTarget( xCache, UNO_QUERY );
     if( xTarget.is() && m_xContext.is() )
commit d1a9740735bcafe71325cb82bcebd82d219e2172
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Tue Oct 1 19:46:53 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Wed Oct 2 09:38:35 2024 +0200

    cid#1608281 Data race condition
    
    and
    cid#1608132 Data race condition
    cid#1607743 Data race condition
    cid#1607393 Data race condition
    cid#1607038 Data race condition
    cid#1606543 Data race condition
    
    Change-Id: Id6075bf9f28d3e77a487116f522d38d9e9d3fab1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174363
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>
    Tested-by: Jenkins

diff --git a/ucb/source/sorter/sortresult.cxx b/ucb/source/sorter/sortresult.cxx
index 27d0a504d970..fbcf846f0ac1 100644
--- a/ucb/source/sorter/sortresult.cxx
+++ b/ucb/source/sorter/sortresult.cxx
@@ -236,6 +236,7 @@ sal_Bool SAL_CALL SortedResultSet::next()
 
 sal_Bool SAL_CALL SortedResultSet::isBeforeFirst()
 {
+    std::unique_lock aGuard( maMutex );
     if ( mnCurEntry )
         return false;
     else
@@ -245,6 +246,7 @@ sal_Bool SAL_CALL SortedResultSet::isBeforeFirst()
 
 sal_Bool SAL_CALL SortedResultSet::isAfterLast()
 {
+    std::unique_lock aGuard( maMutex );
     if ( mnCurEntry > mnCount )
         return true;
     else
@@ -254,6 +256,7 @@ sal_Bool SAL_CALL SortedResultSet::isAfterLast()
 
 sal_Bool SAL_CALL SortedResultSet::isFirst()
 {
+    std::unique_lock aGuard( maMutex );
     if ( mnCurEntry == 1 )
         return true;
     else
@@ -263,6 +266,7 @@ sal_Bool SAL_CALL SortedResultSet::isFirst()
 
 sal_Bool SAL_CALL SortedResultSet::isLast()
 {
+    std::unique_lock aGuard( maMutex );
     if ( mnCurEntry == mnCount )
         return true;
     else
@@ -324,6 +328,7 @@ sal_Bool SAL_CALL SortedResultSet::last()
 
 sal_Int32 SAL_CALL SortedResultSet::getRow()
 {
+    std::unique_lock aGuard( maMutex );
     return mnCurEntry;
 }
 

Reply via email to