summaryrefslogtreecommitdiffstats
path: root/include/comphelper
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-11-11 20:41:58 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-11-13 07:34:48 +0100
commite6f2736be82559c513aa07c765e9f6c0dd72072b (patch)
tree0983bd8b2aed66490b6f382885053c61ce9674c4 /include/comphelper
parentrtl::Static->thread-safe static in OIdPropertyArrayUsageHelper (diff)
downloadcore-e6f2736be82559c513aa07c765e9f6c0dd72072b.tar.gz
core-e6f2736be82559c513aa07c765e9f6c0dd72072b.zip
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/comphelper')
-rw-r--r--include/comphelper/IdPropArrayHelper.hxx12
1 files 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 <sal/config.h>
-#include <osl/mutex.hxx>
+#include <mutex>
#include <cppuhelper/propshlp.hxx>
#include <cassert>
#include <unordered_map>
@@ -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 <class TYPE>
OIdPropertyArrayUsageHelper<TYPE>::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<TYPE>::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)