summaryrefslogtreecommitdiff
path: root/ucbhelper
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2024-10-01 19:19:23 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2024-10-02 09:37:52 +0200
commit9ea9c6f0fc5e08167906b22817ad03c3fd072e62 (patch)
tree2c5e1adb8054c435f2f82a804d28fb9974d17b81 /ucbhelper
parentba7199da2e6ec9d58475373f264326fbeb31f4bd (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'ucbhelper')
-rw-r--r--ucbhelper/source/provider/resultsethelper.cxx12
1 files changed, 8 insertions, 4 deletions
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() )