sw/source/core/bastyp/init.cxx            |    6 ++----
 sw/source/core/docnode/swthreadjoiner.cxx |    8 ++------
 2 files changed, 4 insertions(+), 10 deletions(-)

New commits:
commit 8b1399cbb76b2f8b1722cb6a4a77b391f5af0862
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Thu Nov 18 20:44:33 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Fri Nov 19 08:50:02 2021 +0100

    rtl::Static->thread-safe static in sw
    
    Change-Id: Ic69883c66a08654b9c86ca87a640f5070312fa83
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/125499
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sw/source/core/bastyp/init.cxx b/sw/source/core/bastyp/init.cxx
index 0ab9a5c8ae84..8a82d99fc4b2 100644
--- a/sw/source/core/bastyp/init.cxx
+++ b/sw/source/core/bastyp/init.cxx
@@ -114,7 +114,6 @@
 #include <paratr.hxx>
 #include <proofreadingiterator.hxx>
 #include <editeng/editids.hrc>
-#include <rtl/instance.hxx>
 #include <svl/macitem.hxx>
 #include <svx/sdtaitm.hxx>
 #include <swcalwrp.hxx>
@@ -779,13 +778,12 @@ namespace
             return *m_xTransWrp;
         }
     };
-
-    class theTransWrp : public rtl::Static<TransWrp, theTransWrp> {};
 }
 
 const ::utl::TransliterationWrapper& GetAppCmpStrIgnore()
 {
-    return theTransWrp::get().getTransliterationWrapper();
+    static TransWrp theTransWrp;
+    return theTransWrp.getTransliterationWrapper();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/docnode/swthreadjoiner.cxx 
b/sw/source/core/docnode/swthreadjoiner.cxx
index d13540d33ff8..d506bb7f115b 100644
--- a/sw/source/core/docnode/swthreadjoiner.cxx
+++ b/sw/source/core/docnode/swthreadjoiner.cxx
@@ -21,7 +21,6 @@
 #include <com/sun/star/util/JobManager.hpp>
 #include <comphelper/processfactory.hxx>
 #include <osl/mutex.hxx>
-#include <rtl/instance.hxx>
 
 // Testing
 
@@ -29,16 +28,13 @@ using namespace ::com::sun::star;
 
 namespace
 {
-class theJoinerMutex : public rtl::Static<osl::Mutex, theJoinerMutex>
-{
-};
-
 uno::Reference<util::XJobManager> pThreadJoiner;
 }
 
 uno::Reference<util::XJobManager>& SwThreadJoiner::GetThreadJoiner()
 {
-    osl::MutexGuard aGuard(theJoinerMutex::get());
+    static osl::Mutex theJoinerMutex;
+    osl::MutexGuard aGuard(theJoinerMutex);
 
     if (!pThreadJoiner.is())
     {

Reply via email to