osl::Mutex->std::mutex in framework::TransactionManager

Change-Id: I8a1c8e8ccec8ca64cc4f615ea8e9e415a343996d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134396
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2022-05-17 08:09:33 +02:00
parent edb1070f1b
commit 8a29fb3098
2 changed files with 6 additions and 6 deletions
@@ -71,7 +71,7 @@ void TransactionManager::setWorkingMode( EWorkingMode eMode )
// Safe member access.
bool bWaitFor = false;
{
osl::MutexGuard aAccessGuard(m_aAccessLock);
std::unique_lock aAccessGuard(m_aAccessLock);
// Change working mode first!
if (
(m_eWorkingMode == E_INIT && eMode == E_WORK) ||
@@ -137,7 +137,7 @@ void TransactionManager::setWorkingMode( EWorkingMode eMode )
EWorkingMode TransactionManager::getWorkingMode() const
{
// Synchronize access to internal member!
::osl::MutexGuard aAccessLock( m_aAccessLock );
std::unique_lock aAccessLock( m_aAccessLock );
return m_eWorkingMode;
}
@@ -154,7 +154,7 @@ EWorkingMode TransactionManager::getWorkingMode() const
*//*-*****************************************************************************************************/
void TransactionManager::registerTransaction( EExceptionMode eMode )
{
::osl::MutexGuard aAccessGuard( m_aAccessLock );
std::unique_lock aAccessGuard( m_aAccessLock );
switch( m_eWorkingMode )
{
case E_INIT:
@@ -201,7 +201,7 @@ void TransactionManager::unregisterTransaction()
{
// This call could not rejected!
// Safe access to internal member.
::osl::MutexGuard aAccessGuard( m_aAccessLock );
std::unique_lock aAccessGuard( m_aAccessLock );
// Deregister this transaction.
// If it was the last one ... open gate to enable changing of working mode!
+2 -2
View File
@@ -19,7 +19,7 @@
#pragma once
#include <osl/mutex.hxx>
#include <mutex>
#include "gate.hxx"
@@ -111,7 +111,7 @@ class TransactionManager
private:
mutable ::osl::Mutex m_aAccessLock; /// regulate access on internal member of this instance
mutable std::mutex m_aAccessLock; /// regulate access on internal member of this instance
Gate m_aBarrier; /// used to block transactions requests during change or work mode
EWorkingMode m_eWorkingMode; /// current working mode of object which use this manager (used to reject calls at wrong time)
sal_Int32 m_nTransactionCount; /// every transaction request is registered by this counter