diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2024-10-01 19:30:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2024-10-02 09:38:24 +0200 |
commit | 30f437f4fc21ec83a597432a15e0ab570252a93d (patch) | |
tree | ee5cc86297c4b974272aef53e110ba0655b05b5b | |
parent | 187728c38a654e1505d976524899d66fca37e993 (diff) |
cid#1556822 Data race condition
and
cid#1555688 Data race condition
cid#1554983 Data race condition
Change-Id: Iea24c9567de33aeaa519bc6b832ff1338b6d67be
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174362
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Tested-by: Jenkins
-rw-r--r-- | ucb/source/ucp/file/prov.cxx | 9 | ||||
-rw-r--r-- | ucb/source/ucp/file/prov.hxx | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx index 77e7772db7e2..40484c5d9a3c 100644 --- a/ucb/source/ucp/file/prov.cxx +++ b/ucb/source/ucp/file/prov.cxx @@ -300,9 +300,8 @@ XPropertySetInfoImpl2::hasPropertyByName( } -void FileProvider::initProperties() +void FileProvider::initProperties(std::unique_lock<std::mutex>& /*rGuard*/) { - std::scoped_lock aGuard( m_aMutex ); if( m_xPropertySetInfo.is() ) return; @@ -332,7 +331,8 @@ void FileProvider::initProperties() Reference< XPropertySetInfo > SAL_CALL FileProvider::getPropertySetInfo( ) { - initProperties(); + std::unique_lock aGuard( m_aMutex ); + initProperties(aGuard); return m_xPropertySetInfo; } @@ -352,7 +352,8 @@ Any SAL_CALL FileProvider::getPropertyValue( const OUString& aPropertyName ) { - initProperties(); + std::unique_lock aGuard( m_aMutex ); + initProperties(aGuard); if( aPropertyName == "FileSystemNotation" ) { return Any(m_FileSystemNotation); diff --git a/ucb/source/ucp/file/prov.hxx b/ucb/source/ucp/file/prov.hxx index 311c1be0e469..3d1f9d7f63a0 100644 --- a/ucb/source/ucp/file/prov.hxx +++ b/ucb/source/ucp/file/prov.hxx @@ -143,7 +143,7 @@ namespace fileaccess { // Members css::uno::Reference< css::uno::XComponentContext > m_xContext; - void initProperties(); + void initProperties(std::unique_lock<std::mutex>& rGuard); std::mutex m_aMutex; OUString m_HostName; OUString m_HomeDirectory; |