framework/source/inc/loadenv/actionlockguard.hxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 449977192b04878a2e3ea0ce1ff3445d02f084ce
Author:     Noel Grandin <[email protected]>
AuthorDate: Sun Nov 21 14:16:42 2021 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sun Nov 21 19:43:10 2021 +0100

    osl::Mutex->std::mutex in ActionLockGuard
    
    Change-Id: I8081d017f8a03be94b60011fcd4eb34eba786aa9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125623
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/framework/source/inc/loadenv/actionlockguard.hxx 
b/framework/source/inc/loadenv/actionlockguard.hxx
index dd3c9ab51280..ee52fcc0dc54 100644
--- a/framework/source/inc/loadenv/actionlockguard.hxx
+++ b/framework/source/inc/loadenv/actionlockguard.hxx
@@ -20,7 +20,7 @@
 #pragma once
 
 #include <com/sun/star/document/XActionLockable.hpp>
-#include <osl/mutex.hxx>
+#include <mutex>
 
 namespace framework{
 
@@ -36,7 +36,7 @@ class ActionLockGuard final
     // member
 
     private:
-        osl::Mutex m_mutex;
+        std::mutex m_mutex;
 
         /** @short  points to the object, which can be locked from outside. */
         css::uno::Reference< css::document::XActionLockable > m_xActionLock;
@@ -81,7 +81,7 @@ class ActionLockGuard final
          */
         bool setResource(const css::uno::Reference< 
css::document::XActionLockable >& xLock)
         {
-            osl::MutexGuard g(m_mutex);
+            std::unique_lock g(m_mutex);
 
             if (m_bActionLocked || !xLock.is())
                 return false;
@@ -107,7 +107,7 @@ class ActionLockGuard final
         void freeResource()
         {
             // SAFE -> ..........................
-            osl::ClearableMutexGuard aMutexLock(m_mutex);
+            std::unique_lock aMutexLock(m_mutex);
 
             css::uno::Reference< css::document::XActionLockable > xLock   = 
m_xActionLock;
             bool                                                  bLocked = 
m_bActionLocked;
@@ -115,7 +115,7 @@ class ActionLockGuard final
             m_xActionLock.clear();
             m_bActionLocked = false;
 
-            aMutexLock.clear();
+            aMutexLock.unlock();
             // <- SAFE ..........................
 
             if (bLocked && xLock.is())
@@ -125,7 +125,7 @@ class ActionLockGuard final
         /** @short  unlock the internal wrapped resource, if it's not already 
done. */
         void unlock()
         {
-            osl::MutexGuard g(m_mutex);
+            std::unique_lock g(m_mutex);
             if (m_bActionLocked && m_xActionLock.is())
             {
                 m_xActionLock->removeActionLock();

Reply via email to