summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-11-21 14:15:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-11-22 07:55:42 +0100
commitc36a21e4a3ee788b14b6925de585805556959800 (patch)
treef76a5cf77f44439365b50d0d623eba1739615849 /framework
parent16289b6de6ba37c7008fb198260517f3bc505bf4 (diff)
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.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
-rw-r--r--framework/source/dispatch/windowcommanddispatch.cxx12
-rw-r--r--framework/source/inc/dispatch/windowcommanddispatch.hxx3
2 files changed, 8 insertions, 7 deletions
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;