summaryrefslogtreecommitdiff
path: root/svtools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-08-03 11:36:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-08-03 12:20:53 +0200
commit05ab38359ae72f2a54dc0b5f1b84ac5f649c507a (patch)
tree5830c7ee2442984e0bc804def7bd95ddd8a25410 /svtools
parent5afdcad4c0e7850b18996c549892b9360cd8973f (diff)
Consolidate on C++17 std::scoped_lock instead of std::lock_guard
as in commit 9376f65a26240441bf9dd6ae1f69886dc9fa60fa Change-Id: I3ad9afd4d113582a214a4a4bc7eea55e38cd6ff9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119927 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svtools')
-rw-r--r--svtools/source/config/itemholder2.cxx4
-rw-r--r--svtools/source/config/optionsdrawinglayer.cxx6
-rw-r--r--svtools/source/control/asynclink.cxx6
-rw-r--r--svtools/source/control/inettbc.cxx10
-rw-r--r--svtools/source/control/valueacc.cxx6
5 files changed, 16 insertions, 16 deletions
diff --git a/svtools/source/config/itemholder2.cxx b/svtools/source/config/itemholder2.cxx
index 396a90322a65..bc588f9dfe1c 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -86,7 +86,7 @@ void SAL_CALL ItemHolder2::disposing(const css::lang::EventObject&)
void ItemHolder2::impl_addItem(EItem eItem)
{
- std::lock_guard aLock(m_aLock);
+ std::scoped_lock aLock(m_aLock);
for ( auto const & rInfo : m_lItems )
{
@@ -106,7 +106,7 @@ void ItemHolder2::impl_releaseAllItems()
{
std::vector<TItemInfo> items;
{
- std::lock_guard aLock(m_aLock);
+ std::scoped_lock aLock(m_aLock);
items.swap(m_lItems);
}
diff --git a/svtools/source/config/optionsdrawinglayer.cxx b/svtools/source/config/optionsdrawinglayer.cxx
index 43a1d68544f5..7f8a591567b3 100644
--- a/svtools/source/config/optionsdrawinglayer.cxx
+++ b/svtools/source/config/optionsdrawinglayer.cxx
@@ -127,7 +127,7 @@ static bool gbAllowAA = false;
bool IsAAPossibleOnThisSystem()
{
- std::lock_guard aGuard(gaAntiAliasMutex);
+ std::scoped_lock aGuard(gaAntiAliasMutex);
if (!gbAllowAAInit)
{
gbAllowAAInit = true;
@@ -141,7 +141,7 @@ bool IsAntiAliasing()
{
bool bAntiAliasing;
{
- std::lock_guard aGuard(gaAntiAliasMutex);
+ std::scoped_lock aGuard(gaAntiAliasMutex);
if (!gbAntiAliasingInit)
{
gbAntiAliasingInit = true;
@@ -159,7 +159,7 @@ bool IsAntiAliasing()
*/
void SetAntiAliasing( bool bOn, bool bTemporary )
{
- std::lock_guard aGuard(gaAntiAliasMutex);
+ std::scoped_lock aGuard(gaAntiAliasMutex);
if (!bTemporary)
{
std::shared_ptr<comphelper::ConfigurationChanges> batch =
diff --git a/svtools/source/control/asynclink.cxx b/svtools/source/control/asynclink.cxx
index e4faadfffc25..1fb8b613eb09 100644
--- a/svtools/source/control/asynclink.cxx
+++ b/svtools/source/control/asynclink.cxx
@@ -37,7 +37,7 @@ void AsynchronLink::Call( void* pObj, bool bAllowDoubles )
_pArg = pObj;
DBG_ASSERT( bAllowDoubles || !_nEventId, "Already made a call" );
ClearPendingCall();
- std::lock_guard aGuard(_aMutex);
+ std::scoped_lock aGuard(_aMutex);
_nEventId = Application::PostUserEvent( LINK( this, AsynchronLink, HandleCall_PostUserEvent) );
}
@@ -53,7 +53,7 @@ AsynchronLink::~AsynchronLink()
void AsynchronLink::ClearPendingCall()
{
- std::lock_guard aGuard(_aMutex);
+ std::scoped_lock aGuard(_aMutex);
if( _nEventId )
{
Application::RemoveUserEvent( _nEventId );
@@ -64,7 +64,7 @@ void AsynchronLink::ClearPendingCall()
IMPL_LINK_NOARG( AsynchronLink, HandleCall_PostUserEvent, void*, void )
{
{
- std::lock_guard aGuard(_aMutex);
+ std::scoped_lock aGuard(_aMutex);
_nEventId = nullptr;
// need to release the lock before calling the client since
// the client may call back into us
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 61940085eff1..6fee437ead94 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -155,7 +155,7 @@ void SvtMatchContext_Impl::Stop()
css::uno::Reference< css::ucb::XCommandProcessor > proc;
sal_Int32 id(0);
{
- std::lock_guard g(mutex_);
+ std::scoped_lock g(mutex_);
if (!stopped_) {
stopped_ = true;
proc = processor_;
@@ -185,7 +185,7 @@ IMPL_LINK_NOARG( SvtMatchContext_Impl, Select_Impl, void*, void )
{
// avoid recursion through cancel button
{
- std::lock_guard g(mutex_);
+ std::scoped_lock g(mutex_);
if (stopped_) {
// Completion was stopped, no display:
return;
@@ -403,7 +403,7 @@ void SvtMatchContext_Impl::doExecute()
::osl::MutexGuard aGuard( theSvtMatchContextMutex::get() );
{
// have we been stopped while we were waiting for the mutex?
- std::lock_guard g(mutex_);
+ std::scoped_lock g(mutex_);
if (stopped_) {
return;
}
@@ -478,7 +478,7 @@ void SvtMatchContext_Impl::doExecute()
sal_Int32 id = proc->createCommandIdentifier();
try {
{
- std::lock_guard g(mutex_);
+ std::scoped_lock g(mutex_);
processor_ = proc;
commandId_ = id;
}
@@ -503,7 +503,7 @@ void SvtMatchContext_Impl::doExecute()
proc2->releaseCommandIdentifier(id);
}
{
- std::lock_guard g(mutex_);
+ std::scoped_lock g(mutex_);
processor_.clear();
// At least the neon-based WebDAV UCP does not
// properly support aborting commands, so return
diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx
index bca32029f785..7c12373f5982 100644
--- a/svtools/source/control/valueacc.cxx
+++ b/svtools/source/control/valueacc.cxx
@@ -73,7 +73,7 @@ ValueItemAcc::~ValueItemAcc()
void ValueItemAcc::ParentDestroyed()
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
mpParent = nullptr;
}
@@ -261,7 +261,7 @@ lang::Locale SAL_CALL ValueItemAcc::getLocale()
void SAL_CALL ValueItemAcc::addAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
if( !rxListener.is() )
return;
@@ -284,7 +284,7 @@ void SAL_CALL ValueItemAcc::addAccessibleEventListener( const uno::Reference< ac
void SAL_CALL ValueItemAcc::removeAccessibleEventListener( const uno::Reference< accessibility::XAccessibleEventListener >& rxListener )
{
- std::lock_guard aGuard( maMutex );
+ std::scoped_lock aGuard( maMutex );
if( rxListener.is() )
{