summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-02-17 15:05:54 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-02-18 20:40:05 +0000
commit4a4223f924d4ec49b023a85ce37f3788bc699723 (patch)
tree4433cac10a47b29aa4c3c312d0fa43efedd2f443 /sd
parent509ab788baf54285b4e38f2560326657d97510fd (diff)
osl::Mutex->std::mutex in SdGlobalResourceContainer
Change-Id: I521ec7397e9ac54547bc82be6579cbb4fb4fc5a8 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147266 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/tools/SdGlobalResourceContainer.cxx11
1 files changed, 6 insertions, 5 deletions
diff --git a/sd/source/ui/tools/SdGlobalResourceContainer.cxx b/sd/source/ui/tools/SdGlobalResourceContainer.cxx
index a7dbc5f25920..7f692caa157c 100644
--- a/sd/source/ui/tools/SdGlobalResourceContainer.cxx
+++ b/sd/source/ui/tools/SdGlobalResourceContainer.cxx
@@ -31,6 +31,7 @@
#include <algorithm>
#include <memory>
+#include <mutex>
#include <vector>
using namespace ::com::sun::star;
@@ -67,7 +68,7 @@ class SdGlobalResourceContainer::Implementation
private:
friend class SdGlobalResourceContainer;
- ::osl::Mutex maMutex;
+ std::mutex maMutex;
/** All instances of SdGlobalResource in this vector are owned by the
container and will be destroyed when the container is destroyed.
@@ -94,7 +95,7 @@ SdGlobalResourceContainer& SdGlobalResourceContainer::Instance()
void SdGlobalResourceContainer::AddResource (
::std::unique_ptr<SdGlobalResource> pResource)
{
- ::osl::MutexGuard aGuard (mpImpl->maMutex);
+ std::unique_lock aGuard (mpImpl->maMutex);
assert( std::none_of(
mpImpl->maResources.begin(),
@@ -108,7 +109,7 @@ void SdGlobalResourceContainer::AddResource (
void SdGlobalResourceContainer::AddResource (
const std::shared_ptr<SdGlobalResource>& pResource)
{
- ::osl::MutexGuard aGuard (mpImpl->maMutex);
+ std::unique_lock aGuard (mpImpl->maMutex);
Implementation::SharedResourceList::iterator iResource = ::std::find (
mpImpl->maSharedResources.begin(),
@@ -125,7 +126,7 @@ void SdGlobalResourceContainer::AddResource (
void SdGlobalResourceContainer::AddResource (const Reference<XInterface>& rxResource)
{
- ::osl::MutexGuard aGuard (mpImpl->maMutex);
+ std::unique_lock aGuard (mpImpl->maMutex);
Implementation::XInterfaceResourceList::iterator iResource = ::std::find (
mpImpl->maXInterfaceResources.begin(),
@@ -147,7 +148,7 @@ SdGlobalResourceContainer::SdGlobalResourceContainer()
SdGlobalResourceContainer::~SdGlobalResourceContainer()
{
- ::osl::MutexGuard aGuard (mpImpl->maMutex);
+ std::unique_lock aGuard (mpImpl->maMutex);
// Release the resources in reversed order of their addition to the
// container. This is because a resource A added before resource B