diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-03 11:36:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-03 12:20:53 +0200 |
commit | 05ab38359ae72f2a54dc0b5f1b84ac5f649c507a (patch) | |
tree | 5830c7ee2442984e0bc804def7bd95ddd8a25410 /scripting | |
parent | 5afdcad4c0e7850b18996c549892b9360cd8973f (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 'scripting')
-rw-r--r-- | scripting/source/provider/MasterScriptProvider.cxx | 2 | ||||
-rw-r--r-- | scripting/source/provider/ProviderCache.cxx | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index e8719c8cb4aa..57cc596a7878 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -335,7 +335,7 @@ MasterScriptProvider::providerCache() { if ( !m_pPCache ) { - std::lock_guard aGuard( m_mutex ); + std::scoped_lock aGuard( m_mutex ); if ( !m_pPCache ) { Sequence<OUString> denylist { "com.sun.star.script.provider.ScriptProviderForBasic" }; diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx index 765de8c155d0..4fb6c0ba230c 100644 --- a/scripting/source/provider/ProviderCache.cxx +++ b/scripting/source/provider/ProviderCache.cxx @@ -62,7 +62,7 @@ ProviderCache::~ProviderCache() Reference< provider::XScriptProvider > ProviderCache::getProvider( const OUString& providerName ) { - std::lock_guard aGuard( m_mutex ); + std::scoped_lock aGuard( m_mutex ); Reference< provider::XScriptProvider > provider; ProviderDetails_hash::iterator h_it = m_hProviderDetailsCache.find( providerName ); if ( h_it != m_hProviderDetailsCache.end() ) @@ -86,7 +86,7 @@ ProviderCache::getAllProviders() // need to create providers that haven't been created already // so check what providers exist and what ones don't - std::lock_guard aGuard( m_mutex ); + std::scoped_lock aGuard( m_mutex ); Sequence < Reference< provider::XScriptProvider > > providers ( m_hProviderDetailsCache.size() ); // should assert if size !> 0 if ( !m_hProviderDetailsCache.empty() ) @@ -132,7 +132,7 @@ ProviderCache::populateCache() { // wrong name in services.rdb OUString serviceName; - std::lock_guard aGuard( m_mutex ); + std::scoped_lock aGuard( m_mutex ); try { Reference< container::XContentEnumerationAccess > xEnumAccess( m_xMgr, UNO_QUERY_THROW ); |