framework/source/dispatch/windowcommanddispatch.cxx     |   12 ++++++------
 framework/source/inc/dispatch/windowcommanddispatch.hxx |    3 ++-
 2 files changed, 8 insertions(+), 7 deletions(-)

New commits:
commit c36a21e4a3ee788b14b6925de585805556959800
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Nov 21 14:15:04 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Nov 22 07:55:42 2021 +0100

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

diff --git a/framework/source/dispatch/windowcommanddispatch.cxx 
b/framework/source/dispatch/windowcommanddispatch.cxx
index 97e5de5ca2c7..2764cff556ff 100644
--- a/framework/source/dispatch/windowcommanddispatch.cxx
+++ b/framework/source/dispatch/windowcommanddispatch.cxx
@@ -50,9 +50,9 @@ WindowCommandDispatch::~WindowCommandDispatch()
 
 void WindowCommandDispatch::impl_startListening()
 {
-    osl::ClearableMutexGuard aReadLock(m_mutex);
+    std::unique_lock aReadLock(m_mutex);
     css::uno::Reference< css::awt::XWindow > xWindow( m_xWindow.get(), 
css::uno::UNO_QUERY );
-    aReadLock.clear();
+    aReadLock.unlock();
 
     if ( ! xWindow.is())
         return;
@@ -70,9 +70,9 @@ void WindowCommandDispatch::impl_startListening()
 
 void WindowCommandDispatch::impl_stopListening()
 {
-    osl::ClearableMutexGuard aReadLock(m_mutex);
+    std::unique_lock aReadLock(m_mutex);
     css::uno::Reference< css::awt::XWindow > xWindow( m_xWindow.get(), 
css::uno::UNO_QUERY );
-    aReadLock.clear();
+    aReadLock.unlock();
 
     if (!xWindow.is())
         return;
@@ -130,10 +130,10 @@ IMPL_LINK(WindowCommandDispatch, impl_notifyCommand, 
VclWindowEvent&, rEvent, vo
     try
     {
         // SYNCHRONIZED ->
-        osl::ClearableMutexGuard aReadLock(m_mutex);
+        std::unique_lock aReadLock(m_mutex);
         css::uno::Reference< css::frame::XDispatchProvider >   
xProvider(m_xFrame.get(), css::uno::UNO_QUERY_THROW);
         css::uno::Reference< css::uno::XComponentContext >     xContext    = 
m_xContext;
-        aReadLock.clear();
+        aReadLock.unlock();
         // <- SYNCHRONIZED
 
         // check provider ... we know it's weak reference only
diff --git a/framework/source/inc/dispatch/windowcommanddispatch.hxx 
b/framework/source/inc/dispatch/windowcommanddispatch.hxx
index b2637e9338f7..0e592eb40a21 100644
--- a/framework/source/inc/dispatch/windowcommanddispatch.hxx
+++ b/framework/source/inc/dispatch/windowcommanddispatch.hxx
@@ -24,6 +24,7 @@
 
 #include <cppuhelper/weakref.hxx>
 #include <tools/link.hxx>
+#include <mutex>
 
 namespace com::sun::star::uno {
     class XComponentContext;
@@ -46,7 +47,7 @@ namespace framework{
 class WindowCommandDispatch final
 {
     private:
-        osl::Mutex m_mutex;
+        std::mutex m_mutex;
 
         /// can be used to create own needed services on demand.
         css::uno::Reference< css::uno::XComponentContext > m_xContext;

Reply via email to