dbaccess/source/ui/browser/AsynchronousLink.cxx | 12 ++++++------ include/dbaccess/AsynchronousLink.hxx | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-)
New commits: commit aa4d174103f5422168a29b83f596953098e4794c Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Feb 17 13:23:44 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Feb 18 09:48:30 2023 +0000 osl::Mutex->std::mutex in dbaui::OAsynchronousLink Change-Id: Ida29c113db891b260ebc2b6d0d4638cb5224eac6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147231 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/dbaccess/source/ui/browser/AsynchronousLink.cxx b/dbaccess/source/ui/browser/AsynchronousLink.cxx index e4dcdb2f9eeb..538ea702c4ac 100644 --- a/dbaccess/source/ui/browser/AsynchronousLink.cxx +++ b/dbaccess/source/ui/browser/AsynchronousLink.cxx @@ -31,14 +31,14 @@ OAsynchronousLink::OAsynchronousLink(const Link<void*, void>& _rHandler) OAsynchronousLink::~OAsynchronousLink() { { - ::osl::MutexGuard aEventGuard(m_aEventSafety); + std::unique_lock aEventGuard(m_aEventSafety); if (m_nEventId) Application::RemoveUserEvent(m_nEventId); m_nEventId = nullptr; } { - ::osl::MutexGuard aDestructionGuard(m_aDestructionSafety); + std::unique_lock aDestructionGuard(m_aDestructionSafety); // this is just for the case we're deleted while another thread just handled the event : // if this other thread called our link while we were deleting the event here, the // link handler blocked. With leaving the above block it continued, but now we are prevented @@ -48,7 +48,7 @@ OAsynchronousLink::~OAsynchronousLink() void OAsynchronousLink::Call(void* _pArgument) { - ::osl::MutexGuard aEventGuard(m_aEventSafety); + std::unique_lock aEventGuard(m_aEventSafety); if (m_nEventId) Application::RemoveUserEvent(m_nEventId); m_nEventId = Application::PostUserEvent(LINK(this, OAsynchronousLink, OnAsyncCall), _pArgument); @@ -56,7 +56,7 @@ void OAsynchronousLink::Call(void* _pArgument) void OAsynchronousLink::CancelCall() { - ::osl::MutexGuard aEventGuard(m_aEventSafety); + std::unique_lock aEventGuard(m_aEventSafety); if (m_nEventId) Application::RemoveUserEvent(m_nEventId); m_nEventId = nullptr; @@ -65,9 +65,9 @@ void OAsynchronousLink::CancelCall() IMPL_LINK(OAsynchronousLink, OnAsyncCall, void*, _pArg, void) { { - ::osl::MutexGuard aDestructionGuard(m_aDestructionSafety); + std::unique_lock aDestructionGuard(m_aDestructionSafety); { - ::osl::MutexGuard aEventGuard(m_aEventSafety); + std::unique_lock aEventGuard(m_aEventSafety); if (!m_nEventId) // our destructor deleted the event just while we are waiting for m_aEventSafety // -> get outta here diff --git a/include/dbaccess/AsynchronousLink.hxx b/include/dbaccess/AsynchronousLink.hxx index 0b63cbed957d..22c40dc5b714 100644 --- a/include/dbaccess/AsynchronousLink.hxx +++ b/include/dbaccess/AsynchronousLink.hxx @@ -19,7 +19,7 @@ #pragma once -#include <osl/mutex.hxx> +#include <mutex> #include <tools/link.hxx> struct ImplSVEvent; @@ -38,8 +38,8 @@ namespace dbaui class OAsynchronousLink final { Link<void*,void> m_aHandler; - ::osl::Mutex m_aEventSafety; - ::osl::Mutex m_aDestructionSafety; + std::mutex m_aEventSafety; + std::mutex m_aDestructionSafety; ImplSVEvent * m_nEventId; DECL_LINK(OnAsyncCall, void*, void);