cppuhelper/source/servicemanager.cxx |   12 ++++++------
 cppuhelper/source/servicemanager.hxx |    4 ++--
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit 9277faf14a713b8ae88596785874bdcdfc47957c
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun May 8 19:45:23 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon May 9 10:16:39 2022 +0200

    osl::Mutex->std::mutex in cppuhelper::ServiceManager
    
    Change-Id: I2d30fb3c81e791eb554780b5abf4923a33cc884e
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134029
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/cppuhelper/source/servicemanager.cxx 
b/cppuhelper/source/servicemanager.cxx
index 12167739da8d..1a0e85780b21 100644
--- a/cppuhelper/source/servicemanager.cxx
+++ b/cppuhelper/source/servicemanager.cxx
@@ -665,7 +665,7 @@ 
cppuhelper::ServiceManager::Data::Implementation::createInstance(
 {
     css::uno::Reference<css::uno::XInterface> inst;
     if (isSingleInstance) {
-        osl::MutexGuard g(mutex);
+        std::unique_lock g(mutex);
         if (!singleInstance.is()) {
             singleInstance = doCreateInstance(context);
         }
@@ -684,7 +684,7 @@ 
cppuhelper::ServiceManager::Data::Implementation::createInstanceWithArguments(
 {
     css::uno::Reference<css::uno::XInterface> inst;
     if (isSingleInstance) {
-        osl::MutexGuard g(mutex);
+        std::unique_lock g(mutex);
         if (!singleInstance.is()) {
             singleInstance = doCreateInstanceWithArguments(context, arguments);
         }
@@ -751,14 +751,14 @@ void 
cppuhelper::ServiceManager::Data::Implementation::updateDisposeInstance(
     // at most one of the instances obtained via the service manager, in case
     // the implementation hands out different instances):
     if (singletonRequest) {
-        osl::MutexGuard g(mutex);
+        std::unique_lock g(mutex);
         disposeInstance.clear();
         dispose = false;
     } else if (shallDispose()) {
         css::uno::Reference<css::lang::XComponent> comp(
             instance, css::uno::UNO_QUERY);
         if (comp.is()) {
-            osl::MutexGuard g(mutex);
+            std::unique_lock g(mutex);
             if (dispose) {
                 disposeInstance = comp;
             }
@@ -891,7 +891,7 @@ void cppuhelper::ServiceManager::disposing() {
         {
             assert(rEntry.second);
             if (rEntry.second->shallDispose()) {
-                osl::MutexGuard g2(rEntry.second->mutex);
+                std::unique_lock g2(rEntry.second->mutex);
                 if (rEntry.second->disposeInstance.is()) {
                     sngls.push_back(rEntry.second->disposeInstance);
                 }
@@ -901,7 +901,7 @@ void cppuhelper::ServiceManager::disposing() {
         {
             assert(rEntry.second);
             if (rEntry.second->shallDispose()) {
-                osl::MutexGuard g2(rEntry.second->mutex);
+                std::unique_lock g2(rEntry.second->mutex);
                 if (rEntry.second->disposeInstance.is()) {
                     sngls.push_back(rEntry.second->disposeInstance);
                 }
diff --git a/cppuhelper/source/servicemanager.hxx 
b/cppuhelper/source/servicemanager.hxx
index 2228cd1fbbf1..b47d188ca82b 100644
--- a/cppuhelper/source/servicemanager.hxx
+++ b/cppuhelper/source/servicemanager.hxx
@@ -14,6 +14,7 @@
 #include <cassert>
 #include <unordered_map>
 #include <memory>
+#include <mutex>
 #include <string_view>
 #include <vector>
 
@@ -29,7 +30,6 @@
 #include <com/sun/star/uno/Reference.hxx>
 #include <cppuhelper/basemutex.hxx>
 #include <cppuhelper/compbase.hxx>
-#include <osl/mutex.hxx>
 #include <rtl/ustring.hxx>
 
 namespace com::sun::star::lang {
@@ -146,7 +146,7 @@ public:
             css::uno::Reference< css::lang::XComponent > component;
             Status status;
 
-            osl::Mutex mutex;
+            std::mutex mutex;
             css::uno::Reference<css::uno::XInterface> singleInstance;
             css::uno::Reference< css::lang::XComponent > disposeInstance;
             bool dispose;

Reply via email to