summaryrefslogtreecommitdiff
path: root/include/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-05-13 11:08:33 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-05-14 12:37:28 +0200
commit06900403843e4afa413d0ca4e2ea6be761ac668a (patch)
tree406bfb19c88cf19b1f3b54e03e808aa449de16e6 /include/framework
parent09dffa4cea17983748f9a2141bb311886e33b00b (diff)
osl::Mutex->std::mutex in framework::Gate
Change-Id: I72f0ed62a65dbd487a29f409d1941a50cecb894f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134301 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/framework')
-rw-r--r--include/framework/gate.hxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/include/framework/gate.hxx b/include/framework/gate.hxx
index d4e7f3588523..ab9f81c24b2a 100644
--- a/include/framework/gate.hxx
+++ b/include/framework/gate.hxx
@@ -19,7 +19,7 @@
#pragma once
-#include <osl/mutex.hxx>
+#include <mutex>
#include <osl/conditn.hxx>
namespace framework{
@@ -81,7 +81,7 @@ class Gate
void open()
{
// We must safe access to our internal member!
- ::osl::MutexGuard aLock( m_aAccessLock );
+ std::unique_lock aLock( m_aAccessLock );
// Set condition -> wait don't block any longer -> gate is open
m_aPassage.set();
// Check if operation was successful!
@@ -98,7 +98,7 @@ class Gate
void close()
{
// We must safe access to our internal member!
- ::osl::MutexGuard aLock( m_aAccessLock );
+ std::unique_lock aLock( m_aAccessLock );
// Reset condition -> wait blocks now -> gate is closed
m_aPassage.reset();
// Check if operation was successful!
@@ -118,14 +118,14 @@ class Gate
void wait()
{
// We must safe access to our internal member!
- ::osl::ClearableMutexGuard aLock( m_aAccessLock );
+ std::unique_lock aLock( m_aAccessLock );
// If gate not closed - caller can pass it.
if( m_bClosed )
{
// Then we must release used access lock -
// because next call will block...
// and if we hold the access lock nobody else can use this object without a deadlock!
- aLock.clear();
+ aLock.unlock();
// Wait for opening gate...
m_aPassage.wait();
}
@@ -135,7 +135,7 @@ class Gate
private:
- ::osl::Mutex m_aAccessLock;
+ std::mutex m_aAccessLock;
::osl::Condition m_aPassage;
bool m_bClosed;