summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2023-02-17 13:23:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2023-02-18 09:48:30 +0000
commitaa4d174103f5422168a29b83f596953098e4794c (patch)
tree786ba4b5e9ab23a8c9b7ca853c9f3801de024747
parentosl::Mutex->std::mutex in SysCredentialsConfigItem (diff)
downloadcore-aa4d174103f5422168a29b83f596953098e4794c.tar.gz
core-aa4d174103f5422168a29b83f596953098e4794c.zip
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.grandin@collabora.co.uk>
-rw-r--r--dbaccess/source/ui/browser/AsynchronousLink.cxx12
-rw-r--r--include/dbaccess/AsynchronousLink.hxx6
2 files changed, 9 insertions, 9 deletions
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);