summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-07-17 19:40:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-18 14:02:26 +0200
commite62e6b6d018e70bcb1f0486dd72e756b17861b0a (patch)
tree55b510e2a27aaa88386f27ec841fd865aed0ff91 /comphelper
parentee652592142a063de6d3dd3369f488025c5aad8e (diff)
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@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/container/namecontainer.cxx17
1 files changed, 9 insertions, 8 deletions
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();
}