[Libreoffice-commits] core.git: comphelper/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jul 18 12:02:57 UTC 2021
comphelper/source/container/namecontainer.cxx | 17 +++++++++--------
1 file changed, 9 insertions(+), 8 deletions(-)
New commits:
commit e62e6b6d018e70bcb1f0486dd72e756b17861b0a
Author: Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Jul 17 19:40:36 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Jul 18 14:02:26 2021 +0200
osl::Mutex->std::mutex in NameContainer
Change-Id: I4d4e8eab2fb281c5ca330c82f2f5fa5d5e18463a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119123
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/comphelper/source/container/namecontainer.cxx b/comphelper/source/container/namecontainer.cxx
index fc43d871d7e4..d175d25c3b37 100644
--- a/comphelper/source/container/namecontainer.cxx
+++ b/comphelper/source/container/namecontainer.cxx
@@ -20,6 +20,7 @@
#include <sal/config.h>
#include <map>
+#include <mutex>
#include <comphelper/namecontainer.hxx>
#include <comphelper/sequence.hxx>
@@ -58,7 +59,7 @@ namespace comphelper
private:
SvGenericNameContainerMapImpl maProperties;
const css::uno::Type maType;
- osl::Mutex maMutex;
+ std::mutex maMutex;
};
}
@@ -79,7 +80,7 @@ NameContainer::NameContainer( const css::uno::Type& aType )
// XNameContainer
void SAL_CALL NameContainer::insertByName( const OUString& aName, const Any& aElement )
{
- MutexGuard aGuard( maMutex );
+ std::lock_guard aGuard( maMutex );
if( maProperties.find( aName ) != maProperties.end() )
throw ElementExistException();
@@ -92,7 +93,7 @@ void SAL_CALL NameContainer::insertByName( const OUString& aName, const Any& aEl
void SAL_CALL NameContainer::removeByName( const OUString& Name )
{
- MutexGuard aGuard( maMutex );
+ std::lock_guard aGuard( maMutex );
SvGenericNameContainerMapImpl::iterator aIter = maProperties.find( Name );
if( aIter == maProperties.end() )
@@ -105,7 +106,7 @@ void SAL_CALL NameContainer::removeByName( const OUString& Name )
void SAL_CALL NameContainer::replaceByName( const OUString& aName, const Any& aElement )
{
- MutexGuard aGuard( maMutex );
+ std::lock_guard aGuard( maMutex );
SvGenericNameContainerMapImpl::iterator aIter( maProperties.find( aName ) );
if( aIter == maProperties.end() )
@@ -121,7 +122,7 @@ void SAL_CALL NameContainer::replaceByName( const OUString& aName, const Any& aE
Any SAL_CALL NameContainer::getByName( const OUString& aName )
{
- MutexGuard aGuard( maMutex );
+ std::lock_guard aGuard( maMutex );
SvGenericNameContainerMapImpl::iterator aIter = maProperties.find( aName );
if( aIter == maProperties.end() )
@@ -132,14 +133,14 @@ Any SAL_CALL NameContainer::getByName( const OUString& aName )
Sequence< OUString > SAL_CALL NameContainer::getElementNames( )
{
- MutexGuard aGuard( maMutex );
+ std::lock_guard aGuard( maMutex );
return comphelper::mapKeysToSequence(maProperties);
}
sal_Bool SAL_CALL NameContainer::hasByName( const OUString& aName )
{
- MutexGuard aGuard( maMutex );
+ std::lock_guard aGuard( maMutex );
SvGenericNameContainerMapImpl::iterator aIter = maProperties.find( aName );
return aIter != maProperties.end();
@@ -147,7 +148,7 @@ sal_Bool SAL_CALL NameContainer::hasByName( const OUString& aName )
sal_Bool SAL_CALL NameContainer::hasElements( )
{
- MutexGuard aGuard( maMutex );
+ std::lock_guard aGuard( maMutex );
return !maProperties.empty();
}
More information about the Libreoffice-commits
mailing list