diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-08-04 19:01:29 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-05 09:27:42 +0200 |
commit | d924ce30e0ca260682bd2aed192b8b1b2ca3e7c0 (patch) | |
tree | fc0c828a4c3078c783024c1d7c7518503eecc98d /ucb | |
parent | e12d4c7e361f449fcf143a61caed92129aca3468 (diff) |
osl::Mutex->std::mutex in UcbContentProviderProxy
in a couple of spots I dropped the lock guard because
it was only calling a method that already takes the lock.
Change-Id: I7ac57008f92e8aeff60407b064901d0e439e2fdd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120015
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucb')
-rw-r--r-- | ucb/source/core/provprox.cxx | 11 | ||||
-rw-r--r-- | ucb/source/core/provprox.hxx | 4 |
2 files changed, 5 insertions, 10 deletions
diff --git a/ucb/source/core/provprox.cxx b/ucb/source/core/provprox.cxx index 379b6e4887ed..0489123c8294 100644 --- a/ucb/source/core/provprox.cxx +++ b/ucb/source/core/provprox.cxx @@ -136,7 +136,6 @@ UcbContentProviderProxy::queryInterface( const Type & rType ) if ( !aRet.hasValue() ) { // Get original provider and forward the call... - osl::Guard< osl::Mutex > aGuard( m_aMutex ); Reference< XContentProvider > xProvider = getContentProvider(); if ( xProvider.is() ) aRet = xProvider->queryInterface( rType ); @@ -155,7 +154,6 @@ XTYPEPROVIDER_COMMON_IMPL( UcbContentProviderProxy ); Sequence< Type > SAL_CALL UcbContentProviderProxy::getTypes() { // Get original provider and forward the call... - osl::Guard< osl::Mutex > aGuard( m_aMutex ); Reference< XTypeProvider > xProvider( getContentProvider(), UNO_QUERY ); if ( xProvider.is() ) { @@ -201,8 +199,6 @@ Reference< XContent > SAL_CALL UcbContentProviderProxy::queryContent( { // Get original provider and forward the call... - osl::Guard< osl::Mutex > aGuard( m_aMutex ); - Reference< XContentProvider > xProvider = getContentProvider(); if ( xProvider.is() ) return xProvider->queryContent( Identifier ); @@ -218,7 +214,6 @@ sal_Int32 SAL_CALL UcbContentProviderProxy::compareContentIds( { // Get original provider and forward the call... - osl::Guard< osl::Mutex > aGuard( m_aMutex ); Reference< XContentProvider > xProvider = getContentProvider(); if ( xProvider.is() ) return xProvider->compareContentIds( Id1, Id2 ); @@ -241,7 +236,7 @@ UcbContentProviderProxy::registerInstance( const OUString& Template, { // Just remember that this method was called ( and the params ). - osl::Guard< osl::Mutex > aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); if ( !m_bRegister ) { @@ -261,7 +256,7 @@ Reference< XContentProvider > SAL_CALL UcbContentProviderProxy::deregisterInstance( const OUString& Template, const OUString& Arguments ) { - osl::Guard< osl::Mutex > aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); // registerInstance called at proxy and at original? if ( m_bRegister && m_xTargetProvider.is() ) @@ -296,7 +291,7 @@ UcbContentProviderProxy::deregisterInstance( const OUString& Template, Reference< XContentProvider > SAL_CALL UcbContentProviderProxy::getContentProvider() { - osl::Guard< osl::Mutex > aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); if ( !m_xProvider.is() ) { try diff --git a/ucb/source/core/provprox.hxx b/ucb/source/core/provprox.hxx index a57516c37798..ccab5781810e 100644 --- a/ucb/source/core/provprox.hxx +++ b/ucb/source/core/provprox.hxx @@ -19,7 +19,6 @@ #pragma once -#include <osl/mutex.hxx> #include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XTypeProvider.hpp> #include <com/sun/star/lang/XServiceInfo.hpp> @@ -32,6 +31,7 @@ #include <cppuhelper/compbase.hxx> #include <cppuhelper/weak.hxx> #include <cppuhelper/basemutex.hxx> +#include <mutex> @@ -68,7 +68,7 @@ class UcbContentProviderProxy : public css::ucb::XContentProvider, public css::ucb::XParameterizedContentProvider { - ::osl::Mutex m_aMutex; + std::mutex m_aMutex; OUString m_aService; OUString m_aTemplate; OUString m_aArguments; |