summaryrefslogtreecommitdiff
path: root/toolkit/source/controls
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-08-23 21:44:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-25 09:10:50 +0200
commitb27ede1a629ac2b5f9e98def37326d546923edec (patch)
treec3bd097378ce5107895551c6f179321ede9989be /toolkit/source/controls
parent400a44261c3891c1fb99b5339ada69cbc4777dd0 (diff)
osl::Mutex->std::mutex in ResourceListener
Change-Id: Ide7073273be3405a1d78687a2d6dd12369dd226d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120955 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'toolkit/source/controls')
-rw-r--r--toolkit/source/controls/controlmodelcontainerbase.cxx34
1 files changed, 17 insertions, 17 deletions
diff --git a/toolkit/source/controls/controlmodelcontainerbase.cxx b/toolkit/source/controls/controlmodelcontainerbase.cxx
index 62453331474b..2731423fdf5e 100644
--- a/toolkit/source/controls/controlmodelcontainerbase.cxx
+++ b/toolkit/source/controls/controlmodelcontainerbase.cxx
@@ -1084,19 +1084,19 @@ void ResourceListener::startListening(
{
{
// --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
bool bListening( m_bListening );
bool bResourceSet( m_xResource.is() );
- aGuard.clear();
+ aGuard.unlock();
// --- SAFE ---
if ( bListening && bResourceSet )
stopListening();
// --- SAFE ---
- aGuard.reset();
+ aGuard.lock();
m_xResource = rResource;
- aGuard.clear();
+ aGuard.unlock();
// --- SAFE ---
}
@@ -1108,7 +1108,7 @@ void ResourceListener::startListening(
rResource->addModifyListener( this );
// --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ std::scoped_lock aGuard( m_aMutex );
m_bListening = true;
// --- SAFE ---
}
@@ -1126,10 +1126,10 @@ void ResourceListener::stopListening()
Reference< util::XModifyBroadcaster > xModifyBroadcaster;
// --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
if ( m_bListening && m_xResource.is() )
xModifyBroadcaster = m_xResource;
- aGuard.clear();
+ aGuard.unlock();
// --- SAFE ---
if ( !xModifyBroadcaster.is() )
@@ -1138,10 +1138,10 @@ void ResourceListener::stopListening()
try
{
// --- SAFE ---
- aGuard.reset();
+ aGuard.lock();
m_bListening = false;
m_xResource.clear();
- aGuard.clear();
+ aGuard.unlock();
// --- SAFE ---
xModifyBroadcaster->removeModifyListener( this );
@@ -1162,9 +1162,9 @@ void SAL_CALL ResourceListener::modified(
Reference< util::XModifyListener > xListener;
// --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
xListener = m_xListener;
- aGuard.clear();
+ aGuard.unlock();
// --- SAFE ---
if ( !xListener.is() )
@@ -1191,21 +1191,21 @@ void SAL_CALL ResourceListener::disposing(
Reference< resource::XStringResourceResolver > xResource;
// --- SAFE ---
- ::osl::ResettableGuard < ::osl::Mutex > aGuard( m_aMutex );
+ std::unique_lock aGuard( m_aMutex );
Reference< XInterface > xIfacRes( m_xResource, UNO_QUERY );
Reference< XInterface > xIfacList( m_xListener, UNO_QUERY );
- aGuard.clear();
+ aGuard.unlock();
// --- SAFE ---
if ( Source.Source == xIfacRes )
{
// --- SAFE ---
- aGuard.reset();
+ aGuard.lock();
m_bListening = false;
xResource = m_xResource;
xListener = m_xListener;
m_xResource.clear();
- aGuard.clear();
+ aGuard.unlock();
// --- SAFE ---
if ( xListener.is() )
@@ -1226,13 +1226,13 @@ void SAL_CALL ResourceListener::disposing(
else if ( Source.Source == xIfacList )
{
// --- SAFE ---
- aGuard.reset();
+ aGuard.lock();
m_bListening = false;
xListener = m_xListener;
xResource = m_xResource;
m_xResource.clear();
m_xListener.clear();
- aGuard.clear();
+ aGuard.unlock();
// --- SAFE ---
// Remove ourself as listener from resource resolver