[Libreoffice-commits] core.git: scripting/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sun Aug 1 19:01:56 UTC 2021


 scripting/source/provider/ProviderCache.cxx |    6 +++---
 scripting/source/provider/ProviderCache.hxx |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

New commits:
commit 933cf264b29307ce5cdf489ff89f5da889f5d298
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Aug 1 12:58:19 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sun Aug 1 21:01:23 2021 +0200

    osl::Mutex->std::mutex in ProviderCache
    
    Change-Id: Icf3afc783804c376fae94d0132e5040453e0d47a
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119820
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/scripting/source/provider/ProviderCache.cxx b/scripting/source/provider/ProviderCache.cxx
index 4291d811c7a8..765de8c155d0 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 )
 {
-    ::osl::Guard< osl::Mutex > aGuard( m_mutex );
+    std::lock_guard 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
 
-    ::osl::Guard< osl::Mutex > aGuard( m_mutex );
+    std::lock_guard 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;
-    ::osl::Guard< osl::Mutex > aGuard( m_mutex );
+    std::lock_guard aGuard( m_mutex );
     try
     {
         Reference< container::XContentEnumerationAccess > xEnumAccess( m_xMgr, UNO_QUERY_THROW );
diff --git a/scripting/source/provider/ProviderCache.hxx b/scripting/source/provider/ProviderCache.hxx
index 5e00217875a2..6b5059370c05 100644
--- a/scripting/source/provider/ProviderCache.hxx
+++ b/scripting/source/provider/ProviderCache.hxx
@@ -19,13 +19,13 @@
 
 #pragma once
 
-#include <osl/mutex.hxx>
 #include <rtl/ustring.hxx>
 #include <com/sun/star/lang/XSingleComponentFactory.hpp>
 #include <com/sun/star/lang/XMultiComponentFactory.hpp>
 
 #include <com/sun/star/script/provider/XScriptProvider.hpp>
 
+#include <mutex>
 #include <unordered_map>
 
 namespace func_provider
@@ -68,7 +68,7 @@ private:
     bool isInDenyList( const OUString& serviceName );
     css::uno::Sequence< OUString >  m_sDenyList;
     ProviderDetails_hash  m_hProviderDetailsCache;
-    osl::Mutex m_mutex;
+    std::mutex m_mutex;
     css::uno::Sequence< css::uno::Any >  m_Sctx;
     css::uno::Reference< css::uno::XComponentContext > m_xContext;
     css::uno::Reference< css::lang::XMultiComponentFactory > m_xMgr;


More information about the Libreoffice-commits mailing list