diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2024-09-29 19:27:50 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-09-30 18:24:30 +0200 |
commit | da8a36b4f4fa86831dabbfe7794c835cd5f975b4 (patch) | |
tree | 35f494584d34bdd4744dd028fc50e8789e4aec2d /dbaccess | |
parent | 080913a6b9159f11de93c106669c0a2f60db2ebc (diff) |
CID#1607066:Data race condition (MISSING_LOCK)
which means we need to push knowledge
about the locking down into ucbhelper::Result
since the implementation classes there
want to call back into the parent.
and also
CID#1607968:Data race condition (MISSING_LOCK)
CID#1606657:Data race condition (MISSING_LOCK)
CID#1607112:Data race condition (MISSING_LOCK)
CID#1608365:Data race condition (MISSING_LOCK)
CID#1607159:Data race condition (MISSING_LOCK)
CID#1607018:Data race condition (MISSING_LOCK)
CID#1607421:Data race condition (MISSING_LOCK)
CID#1607766:Data race condition (MISSING_LOCK)
CID#1606872:Data race condition (MISSING_LOCK)
CID#1608523:Data race condition (MISSING_LOCK
CID#1607191:Data race condition (MISSING_LOCK)
CID#1608345:Data race condition (MISSING_LOCK)
CID#1608577:(#1 of 1):Data race condition (MISSING_LOCK)
CID#1607210:Data race condition (MISSING_LOCK)
CID#1607132:Data race condition (MISSING_LOCK)
CID#1608256:Data race condition (MISSING_LOCK)
CID#1607482:Data race condition (MISSING_LOCK)
CID#1607935:Data race condition (MISSING_LOCK)
CID#1608070:Data race condition (MISSING_LOCK)
CID#1607901:Data race condition (MISSING_LOCK)
CID#1608013:Data race condition (MISSING_LOCK)
CID#1607506:Data race condition (MISSING_LOCK)
CID#1607526:Data race condition (MISSING_LOCK)
CID#1607044:Data race condition (MISSING_LOCK)
CID#1607708:Data race condition (MISSING_LOCK)
CID#1608041:Data race condition (MISSING_LOCK)
CID#1608207:Data race condition (MISSING_LOCK)
CID#1608028:Data race condition (MISSING_LOCK)
CID#1608168:Data race condition (MISSING_LOCK)
CID#1607561:Data race condition (MISSING_LOCK)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
CID#1607689:Check of thread-shared field evades lock acquisition (LOCK_EVASION)
Change-Id: Ifbe908a4a86ab8c5fa1c4ed3b6f9466508e4900e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174204
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r-- | dbaccess/source/core/dataaccess/myucp_datasupplier.cxx | 30 | ||||
-rw-r--r-- | dbaccess/source/core/dataaccess/myucp_datasupplier.hxx | 17 |
2 files changed, 26 insertions, 21 deletions
diff --git a/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx b/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx index 1b04127cf67f..597933b9db5f 100644 --- a/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx +++ b/dbaccess/source/core/dataaccess/myucp_datasupplier.cxx @@ -42,7 +42,7 @@ DataSupplier::~DataSupplier() { } -OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) +OUString DataSupplier::queryContentIdentifierString( std::unique_lock<std::mutex>& rResultSetGuard, sal_uInt32 nIndex ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -56,7 +56,7 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) } } - if ( getResult( nIndex ) ) + if ( getResult( rResultSetGuard, nIndex ) ) { OUString aId = m_xContent->getIdentifier()->getContentIdentifier(); @@ -72,7 +72,7 @@ OUString DataSupplier::queryContentIdentifierString( sal_uInt32 nIndex ) } Reference< XContentIdentifier > -DataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) +DataSupplier::queryContentIdentifier( std::unique_lock<std::mutex>& rResultSetGuard, sal_uInt32 nIndex ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -86,7 +86,7 @@ DataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) } } - OUString aId = queryContentIdentifierString( nIndex ); + OUString aId = queryContentIdentifierString( rResultSetGuard, nIndex ); if ( !aId.isEmpty() ) { Reference< XContentIdentifier > xId = new ::ucbhelper::ContentIdentifier( aId ); @@ -97,7 +97,7 @@ DataSupplier::queryContentIdentifier( sal_uInt32 nIndex ) } Reference< XContent > -DataSupplier::queryContent( sal_uInt32 _nIndex ) +DataSupplier::queryContent( std::unique_lock<std::mutex>& rResultSetGuard, sal_uInt32 _nIndex ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -111,7 +111,7 @@ DataSupplier::queryContent( sal_uInt32 _nIndex ) } } - Reference< XContentIdentifier > xId = queryContentIdentifier( _nIndex ); + Reference< XContentIdentifier > xId = queryContentIdentifier( rResultSetGuard, _nIndex ); if ( xId.is() ) { try @@ -133,7 +133,7 @@ DataSupplier::queryContent( sal_uInt32 _nIndex ) return Reference< XContent >(); } -bool DataSupplier::getResult( sal_uInt32 nIndex ) +bool DataSupplier::getResult( std::unique_lock<std::mutex>& rResultSetGuard, sal_uInt32 nIndex ) { osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); @@ -177,16 +177,16 @@ bool DataSupplier::getResult( sal_uInt32 nIndex ) aGuard.clear(); if ( static_cast<size_t>(nOldCount) < m_aResults.size() ) - xResultSet->rowCountChanged( nOldCount, m_aResults.size() ); + xResultSet->rowCountChanged( rResultSetGuard, nOldCount, m_aResults.size() ); if ( m_bCountFinal ) - xResultSet->rowCountFinal(); + xResultSet->rowCountFinal(rResultSetGuard); } return bFound; } -sal_uInt32 DataSupplier::totalCount() +sal_uInt32 DataSupplier::totalCount(std::unique_lock<std::mutex>& rResultSetGuard) { osl::ClearableGuard< osl::Mutex > aGuard( m_aMutex ); @@ -212,9 +212,9 @@ sal_uInt32 DataSupplier::totalCount() aGuard.clear(); if ( static_cast<size_t>(nOldCount) < m_aResults.size() ) - xResultSet->rowCountChanged( nOldCount, m_aResults.size() ); + xResultSet->rowCountChanged( rResultSetGuard, nOldCount, m_aResults.size() ); - xResultSet->rowCountFinal(); + xResultSet->rowCountFinal(rResultSetGuard); } return m_aResults.size(); @@ -231,7 +231,7 @@ bool DataSupplier::isCountFinal() } Reference< XRow > -DataSupplier::queryPropertyValues( sal_uInt32 nIndex ) +DataSupplier::queryPropertyValues( std::unique_lock<std::mutex>& rResultSetGuard, sal_uInt32 nIndex ) { osl::Guard< osl::Mutex > aGuard( m_aMutex ); @@ -245,10 +245,10 @@ DataSupplier::queryPropertyValues( sal_uInt32 nIndex ) } } - if ( getResult( nIndex ) ) + if ( getResult( rResultSetGuard, nIndex ) ) { if ( !m_aResults[ nIndex ]->xContent.is() ) - queryContent(nIndex); + queryContent(rResultSetGuard, nIndex); Reference< XRow > xRow = m_aResults[ nIndex ]->xContent->getPropertyValues(getResultSet()->getProperties()); m_aResults[ nIndex ]->xRow = xRow; diff --git a/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx b/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx index 65a45ad7fef6..b9eecab2ddff 100644 --- a/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx +++ b/dbaccess/source/core/dataaccess/myucp_datasupplier.hxx @@ -52,18 +52,23 @@ public: explicit DataSupplier(const rtl::Reference<ODocumentContainer>& rxContent); virtual ~DataSupplier() override; - virtual OUString queryContentIdentifierString(sal_uInt32 nIndex) override; + virtual OUString queryContentIdentifierString(std::unique_lock<std::mutex>& rResultSetGuard, + sal_uInt32 nIndex) override; virtual css::uno::Reference<css::ucb::XContentIdentifier> - queryContentIdentifier(sal_uInt32 nIndex) override; - virtual css::uno::Reference<css::ucb::XContent> queryContent(sal_uInt32 nIndex) override; + queryContentIdentifier(std::unique_lock<std::mutex>& rResultSetGuard, + sal_uInt32 nIndex) override; + virtual css::uno::Reference<css::ucb::XContent> + queryContent(std::unique_lock<std::mutex>& rResultSetGuard, sal_uInt32 nIndex) override; - virtual bool getResult(sal_uInt32 nIndex) override; + virtual bool getResult(std::unique_lock<std::mutex>& rResultSetGuard, + sal_uInt32 nIndex) override; - virtual sal_uInt32 totalCount() override; + virtual sal_uInt32 totalCount(std::unique_lock<std::mutex>& rResultSetGuard) override; virtual sal_uInt32 currentCount() override; virtual bool isCountFinal() override; - virtual css::uno::Reference<css::sdbc::XRow> queryPropertyValues(sal_uInt32 nIndex) override; + virtual css::uno::Reference<css::sdbc::XRow> + queryPropertyValues(std::unique_lock<std::mutex>& rResultSetGuard, sal_uInt32 nIndex) override; virtual void releasePropertyValues(sal_uInt32 nIndex) override; virtual void close() override; |