diff options
author | Noel Grandin <noelgrandin@collabora.co.uk> | 2023-03-16 11:22:12 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-16 16:21:04 +0000 |
commit | 45946d9465b197a20f12828815da6d9da3b2e3e7 (patch) | |
tree | c12ab59f330d14da6ceacebb150325961d860e7d /vcl/win | |
parent | 40d717c7bea493a24b9fd888bc71647d8793323b (diff) |
osl::Mutex->std::mutex in CMtaOleClipboard
Change-Id: If19fe618de0c316ffa6d74432b03c507b960a891
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148953
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/win')
-rw-r--r-- | vcl/win/dtrans/MtaOleClipb.cxx | 12 | ||||
-rw-r--r-- | vcl/win/dtrans/MtaOleClipb.hxx | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/vcl/win/dtrans/MtaOleClipb.cxx b/vcl/win/dtrans/MtaOleClipb.cxx index 865025057dcc..8753cf46cbae 100644 --- a/vcl/win/dtrans/MtaOleClipb.cxx +++ b/vcl/win/dtrans/MtaOleClipb.cxx @@ -438,7 +438,7 @@ bool CMtaOleClipboard::onRegisterClipViewer( LPFNC_CLIPVIEWER_CALLBACK_t pfncCli // we need exclusive access because the clipboard changed notifier // thread also accesses this variable - MutexGuard aGuard( m_pfncClipViewerCallbackMutex ); + std::unique_lock aGuard( m_pfncClipViewerCallbackMutex ); // register if not yet done if ( ( nullptr != pfncClipViewerCallback ) && ( nullptr == m_pfncClipViewerCallback ) ) @@ -502,7 +502,7 @@ LRESULT CMtaOleClipboard::onClipboardUpdate() // registering ourself as clipboard if ( !m_bInRegisterClipViewer ) { - MutexGuard aGuard( m_ClipboardChangedEventCountMutex ); + std::unique_lock aGuard( m_ClipboardChangedEventCountMutex ); m_ClipboardChangedEventCount++; SetEvent( m_hClipboardChangedEvent ); @@ -713,7 +713,7 @@ DWORD WINAPI CMtaOleClipboard::clipboardChangedNotifierThreadProc( _In_ LPVOID p MsgWaitForMultipleObjects(2, pInst->m_hClipboardChangedNotifierEvents, false, INFINITE, QS_ALLINPUT | QS_ALLPOSTMESSAGE); - ClearableMutexGuard aGuard2( pInst->m_ClipboardChangedEventCountMutex ); + std::unique_lock aGuard2( pInst->m_ClipboardChangedEventCountMutex ); if ( pInst->m_ClipboardChangedEventCount > 0 ) { @@ -721,17 +721,17 @@ DWORD WINAPI CMtaOleClipboard::clipboardChangedNotifierThreadProc( _In_ LPVOID p if ( 0 == pInst->m_ClipboardChangedEventCount ) ResetEvent( pInst->m_hClipboardChangedEvent ); - aGuard2.clear( ); + aGuard2.unlock( ); // nobody should touch m_pfncClipViewerCallback while we do - MutexGuard aClipViewerGuard( pInst->m_pfncClipViewerCallbackMutex ); + std::unique_lock aClipViewerGuard( pInst->m_pfncClipViewerCallbackMutex ); // notify all clipboard listener if ( pInst->m_pfncClipViewerCallback ) pInst->m_pfncClipViewerCallback( ); } else - aGuard2.clear( ); + aGuard2.unlock( ); } return 0; diff --git a/vcl/win/dtrans/MtaOleClipb.hxx b/vcl/win/dtrans/MtaOleClipb.hxx index a76b85e3b059..c510418f4981 100644 --- a/vcl/win/dtrans/MtaOleClipb.hxx +++ b/vcl/win/dtrans/MtaOleClipb.hxx @@ -20,7 +20,7 @@ #pragma once #include <sal/types.h> -#include <osl/mutex.hxx> +#include <mutex> #include <objidl.h> @@ -96,10 +96,10 @@ private: HANDLE m_hClipboardChangedNotifierEvents[2]; HANDLE& m_hClipboardChangedEvent; HANDLE& m_hTerminateClipboardChangedNotifierEvent; - osl::Mutex m_ClipboardChangedEventCountMutex; + std::mutex m_ClipboardChangedEventCountMutex; sal_Int32 m_ClipboardChangedEventCount; - osl::Mutex m_pfncClipViewerCallbackMutex; + std::mutex m_pfncClipViewerCallbackMutex; static CMtaOleClipboard* s_theMtaOleClipboardInst; |