include/svx/fmsrccfg.hxx | 2 +- include/unotools/configvaluecontainer.hxx | 3 ++- unotools/source/config/configvaluecontainer.cxx | 22 +++++++++++----------- 3 files changed, 14 insertions(+), 13 deletions(-)
New commits: commit eb11a07c4891412b48de00105d13d18241916506 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Feb 21 09:29:21 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Tue Feb 21 11:02:47 2023 +0000 osl::Mutex->std::mutex in FmSearchConfigItem Change-Id: Ic7d805f05f906a1f61ad958d33de0102d6835a36 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147380 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/svx/fmsrccfg.hxx b/include/svx/fmsrccfg.hxx index ea8e80fe780a..b7f29d793bb8 100644 --- a/include/svx/fmsrccfg.hxx +++ b/include/svx/fmsrccfg.hxx @@ -97,7 +97,7 @@ namespace svxform // order matters! { private: - ::osl::Mutex m_aMutex; + std::mutex m_aMutex; // wrapper properties: // some of the members of FmSearchParams are must be translated to be stored in the configuration diff --git a/include/unotools/configvaluecontainer.hxx b/include/unotools/configvaluecontainer.hxx index c4447fca28f4..a123dba58867 100644 --- a/include/unotools/configvaluecontainer.hxx +++ b/include/unotools/configvaluecontainer.hxx @@ -23,6 +23,7 @@ #include <unotools/unotoolsdllapi.h> #include <com/sun/star/uno/Type.hxx> #include <memory> +#include <mutex> namespace com::sun::star::uno { template <typename > class Reference; } @@ -82,7 +83,7 @@ namespace utl */ OConfigurationValueContainer( const css::uno::Reference< css::uno::XComponentContext >& _rxORB, - ::osl::Mutex& _rAccessSafety, + std::mutex& _rAccessSafety, const char* _pConfigLocation, const sal_Int32 _nLevels ); diff --git a/unotools/source/config/configvaluecontainer.cxx b/unotools/source/config/configvaluecontainer.cxx index 10abeaf12896..6852674a95fa 100644 --- a/unotools/source/config/configvaluecontainer.cxx +++ b/unotools/source/config/configvaluecontainer.cxx @@ -91,9 +91,9 @@ namespace utl } static - void lcl_copyData( const NodeValueAccessor& _rAccessor, const Any& _rData, ::osl::Mutex& _rMutex ) + void lcl_copyData( const NodeValueAccessor& _rAccessor, const Any& _rData, std::mutex& _rMutex ) { - ::osl::MutexGuard aGuard( _rMutex ); + std::unique_lock aGuard( _rMutex ); SAL_WARN_IF(!_rAccessor.isBound(), "unotools.config", "::utl::lcl_copyData: invalid accessor!"); switch ( _rAccessor.getLocType() ) @@ -122,9 +122,9 @@ namespace utl } static - void lcl_copyData( Any& _rData, const NodeValueAccessor& _rAccessor, ::osl::Mutex& _rMutex ) + void lcl_copyData( Any& _rData, const NodeValueAccessor& _rAccessor, std::mutex& _rMutex ) { - ::osl::MutexGuard aGuard( _rMutex ); + std::unique_lock aGuard( _rMutex ); SAL_WARN_IF(!_rAccessor.isBound(), "unotools.config", "::utl::lcl_copyData: invalid accessor!" ); switch ( _rAccessor.getLocType() ) @@ -148,10 +148,10 @@ namespace utl { protected: const OConfigurationNode& m_rRootNode; - ::osl::Mutex& m_rMutex; + std::mutex& m_rMutex; public: - SubNodeAccess( const OConfigurationNode& _rRootNode, ::osl::Mutex& _rMutex ) + SubNodeAccess( const OConfigurationNode& _rRootNode, std::mutex& _rMutex ) :m_rRootNode( _rRootNode ) ,m_rMutex( _rMutex ) { @@ -161,7 +161,7 @@ namespace utl struct UpdateFromConfig : public SubNodeAccess { public: - UpdateFromConfig( const OConfigurationNode& _rRootNode, ::osl::Mutex& _rMutex ) : SubNodeAccess( _rRootNode, _rMutex ) { } + UpdateFromConfig( const OConfigurationNode& _rRootNode, std::mutex& _rMutex ) : SubNodeAccess( _rRootNode, _rMutex ) { } void operator() ( NodeValueAccessor const & _rAccessor ) { @@ -172,7 +172,7 @@ namespace utl struct UpdateToConfig : public SubNodeAccess { public: - UpdateToConfig( const OConfigurationNode& _rRootNode, ::osl::Mutex& _rMutex ) : SubNodeAccess( _rRootNode, _rMutex ) { } + UpdateToConfig( const OConfigurationNode& _rRootNode, std::mutex& _rMutex ) : SubNodeAccess( _rRootNode, _rMutex ) { } void operator() ( NodeValueAccessor const & _rAccessor ) { @@ -189,12 +189,12 @@ namespace utl struct OConfigurationValueContainerImpl { Reference< XComponentContext > xORB; // the service factory - ::osl::Mutex& rMutex; // the mutex for accessing the data containers + std::mutex& rMutex; // the mutex for accessing the data containers OConfigurationTreeRoot aConfigRoot; // the configuration node we're accessing std::vector<NodeValueAccessor> aAccessors; // the accessors to the node values - OConfigurationValueContainerImpl( const Reference< XComponentContext >& _rxORB, ::osl::Mutex& _rMutex ) + OConfigurationValueContainerImpl( const Reference< XComponentContext >& _rxORB, std::mutex& _rMutex ) :xORB( _rxORB ) ,rMutex( _rMutex ) { @@ -204,7 +204,7 @@ namespace utl //= OConfigurationValueContainer OConfigurationValueContainer::OConfigurationValueContainer( - const Reference< XComponentContext >& _rxORB, ::osl::Mutex& _rAccessSafety, + const Reference< XComponentContext >& _rxORB, std::mutex& _rAccessSafety, const char* _pConfigLocation, const sal_Int32 _nLevels ) :m_pImpl( new OConfigurationValueContainerImpl( _rxORB, _rAccessSafety ) ) {