diff options
Diffstat (limited to 'dbaccess/source/ui/browser/AsynchronousLink.cxx')
-rw-r--r-- | dbaccess/source/ui/browser/AsynchronousLink.cxx | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/dbaccess/source/ui/browser/AsynchronousLink.cxx b/dbaccess/source/ui/browser/AsynchronousLink.cxx index f42c00d9a944..538ea702c4ac 100644 --- a/dbaccess/source/ui/browser/AsynchronousLink.cxx +++ b/dbaccess/source/ui/browser/AsynchronousLink.cxx @@ -24,8 +24,6 @@ using namespace dbaui; OAsynchronousLink::OAsynchronousLink(const Link<void*, void>& _rHandler) : m_aHandler(_rHandler) - , m_aEventSafety() - , m_aDestructionSafety() , m_nEventId(nullptr) { } @@ -33,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 @@ -50,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); @@ -58,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; @@ -67,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 |