include/framework/gate.hxx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
New commits: commit 06900403843e4afa413d0ca4e2ea6be761ac668a Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri May 13 11:08:33 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat May 14 12:37:28 2022 +0200 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.gran...@collabora.co.uk> 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;