From e6f2736be82559c513aa07c765e9f6c0dd72072b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 11 Nov 2021 20:41:58 +0200 Subject: [PATCH] osl::Mutex->std::mutex in OIdPropertyArrayUsageHelper Change-Id: I19bad304c5c8099fd24be77ec7251e837b513c81 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125117 Tested-by: Jenkins Reviewed-by: Noel Grandin --- include/comphelper/IdPropArrayHelper.hxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/include/comphelper/IdPropArrayHelper.hxx b/include/comphelper/IdPropArrayHelper.hxx index 705de3db8925..8b70db849ed5 100644 --- a/include/comphelper/IdPropArrayHelper.hxx +++ b/include/comphelper/IdPropArrayHelper.hxx @@ -20,7 +20,7 @@ #include -#include +#include #include #include #include @@ -36,7 +36,7 @@ namespace comphelper OIdPropertyArrayUsageHelper(); virtual ~OIdPropertyArrayUsageHelper() { - ::osl::MutexGuard aGuard(theMutex()); + std::unique_lock aGuard(theMutex()); assert(s_nRefCount > 0 && "OIdPropertyArrayUsageHelper::~OIdPropertyArrayUsageHelper : suspicious call : have a refcount of 0 !"); if (!--s_nRefCount) { @@ -64,9 +64,9 @@ namespace comphelper private: static sal_Int32 s_nRefCount; static OIdPropertyArrayMap* s_pMap; - static osl::Mutex& theMutex() + static std::mutex& theMutex() { - static osl::Mutex SINGLETON; + static std::mutex SINGLETON; return SINGLETON; } }; @@ -80,7 +80,7 @@ namespace comphelper template OIdPropertyArrayUsageHelper::OIdPropertyArrayUsageHelper() { - ::osl::MutexGuard aGuard(theMutex()); + std::unique_lock aGuard(theMutex()); // create the map if necessary if (!s_pMap) s_pMap = new OIdPropertyArrayMap; @@ -91,7 +91,7 @@ namespace comphelper ::cppu::IPropertyArrayHelper* OIdPropertyArrayUsageHelper::getArrayHelper(sal_Int32 nId) { assert(s_nRefCount && "OIdPropertyArrayUsageHelper::getArrayHelper : suspicious call : have a refcount of 0 !"); - ::osl::MutexGuard aGuard(theMutex()); + std::unique_lock aGuard(theMutex()); // do we have the array already? auto& rEntry = (*s_pMap)[nId]; if (!rEntry)