[Libreoffice-commits] core.git: include/unotools unotools/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Fri Jan 29 11:55:46 UTC 2021


 include/unotools/moduleoptions.hxx       |    3 ---
 unotools/source/config/moduleoptions.cxx |   23 ++++++-----------------
 2 files changed, 6 insertions(+), 20 deletions(-)

New commits:
commit 497452595bccf939e1a7e6b54b964e34504e5075
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Fri Jan 29 07:11:38 2021 +0100
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Jan 29 12:55:08 2021 +0100

    Replace rtl::Static with function-local static here
    
    Change-Id: Iaba5c16c9f80431a5a9c03b94087e3f0b14fd9d5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/110132
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/include/unotools/moduleoptions.hxx b/include/unotools/moduleoptions.hxx
index 3293560c3733..1324e4d06e18 100644
--- a/include/unotools/moduleoptions.hxx
+++ b/include/unotools/moduleoptions.hxx
@@ -27,7 +27,6 @@
 #include <unotools/options.hxx>
 #include <memory>
 
-namespace osl { class Mutex; }
 namespace com::sun::star::frame { class XModel; }
 namespace com::sun::star::beans { struct PropertyValue; }
 
@@ -168,8 +167,6 @@ class SAL_WARN_UNUSED UNOTOOLS_DLLPUBLIC SvtModuleOptions final : public utl::de
         css::uno::Sequence < OUString > GetAllServiceNames();
 
     private:
-        UNOTOOLS_DLLPRIVATE static ::osl::Mutex& impl_GetOwnStaticMutex();
-
         std::shared_ptr<SvtModuleOptions_Impl>   m_pImpl;
 
 };      // class SvtModuleOptions
diff --git a/unotools/source/config/moduleoptions.cxx b/unotools/source/config/moduleoptions.cxx
index 1468501220ec..ea3db01585c2 100644
--- a/unotools/source/config/moduleoptions.cxx
+++ b/unotools/source/config/moduleoptions.cxx
@@ -761,6 +761,12 @@ void SvtModuleOptions_Impl::MakeReadonlyStatesAvailable()
 namespace {
     //global
     std::weak_ptr<SvtModuleOptions_Impl> g_pModuleOptions;
+
+osl::Mutex& impl_GetOwnStaticMutex()
+{
+    static osl::Mutex s_Mutex;
+    return s_Mutex;
+}
 }
 
 /*-************************************************************************************************************
@@ -907,23 +913,6 @@ bool SvtModuleOptions::IsDataBase() const
     return m_pImpl->IsModuleInstalled( EModule::DATABASE );
 }
 
-namespace
-{
-    class theModuleOptionsMutex : public rtl::Static<osl::Mutex, theModuleOptionsMutex> {};
-}
-/*-****************************************************************************************************
-    @short      return a reference to a static mutex
-    @descr      These class is threadsafe.
-                We create a static mutex only for one time and use it to protect our refcount and container
-                member!
-    @return     A reference to a static mutex member.
-    @threadsafe yes
-*//*-*****************************************************************************************************/
-::osl::Mutex& SvtModuleOptions::impl_GetOwnStaticMutex()
-{
-    return theModuleOptionsMutex::get();
-}
-
 OUString SvtModuleOptions::GetModuleName( EModule eModule ) const
 {
     switch( eModule )


More information about the Libreoffice-commits mailing list