summaryrefslogtreecommitdiff
path: root/scripting
diff options
context:
space:
mode:
Diffstat (limited to 'scripting')
-rw-r--r--scripting/source/basprov/basprov.cxx22
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx14
-rw-r--r--scripting/source/stringresource/stringresource.cxx14
3 files changed, 13 insertions, 37 deletions
diff --git a/scripting/source/basprov/basprov.cxx b/scripting/source/basprov/basprov.cxx
index 6180fa333627..ce71c003d75d 100644
--- a/scripting/source/basprov/basprov.cxx
+++ b/scripting/source/basprov/basprov.cxx
@@ -76,21 +76,13 @@ namespace basprov
static Sequence< OUString > getSupportedServiceNames_BasicProviderImpl()
{
- static Sequence< OUString >* pNames = nullptr;
- if ( !pNames )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !pNames )
- {
- static Sequence< OUString > aNames(4);
- aNames.getArray()[0] = "com.sun.star.script.provider.ScriptProviderForBasic";
- aNames.getArray()[1] = "com.sun.star.script.provider.LanguageScriptProvider";
- aNames.getArray()[2] = "com.sun.star.script.provider.ScriptProvider";
- aNames.getArray()[3] = "com.sun.star.script.browse.BrowseNode";
- pNames = &aNames;
- }
- }
- return *pNames;
+ static Sequence< OUString > s_Names{
+ "com.sun.star.script.provider.ScriptProviderForBasic",
+ "com.sun.star.script.provider.LanguageScriptProvider",
+ "com.sun.star.script.provider.ScriptProvider",
+ "com.sun.star.script.browse.BrowseNode"};
+
+ return s_Names;
}
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 90a28cca56fd..4f979ee54308 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -177,17 +177,9 @@ namespace dlgprov
::osl::Mutex& getMutex()
{
- static ::osl::Mutex* s_pMutex = nullptr;
- if ( !s_pMutex )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !s_pMutex )
- {
- static ::osl::Mutex s_aMutex;
- s_pMutex = &s_aMutex;
- }
- }
- return *s_pMutex;
+ static ::osl::Mutex s_aMutex;
+
+ return s_aMutex;
}
diff --git a/scripting/source/stringresource/stringresource.cxx b/scripting/source/stringresource/stringresource.cxx
index a17977536056..9e29229e13e0 100644
--- a/scripting/source/stringresource/stringresource.cxx
+++ b/scripting/source/stringresource/stringresource.cxx
@@ -62,17 +62,9 @@ namespace stringresource
::osl::Mutex& getMutex()
{
- static ::osl::Mutex* s_pMutex = nullptr;
- if ( !s_pMutex )
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if ( !s_pMutex )
- {
- static ::osl::Mutex s_aMutex;
- s_pMutex = &s_aMutex;
- }
- }
- return *s_pMutex;
+ static ::osl::Mutex s_aMutex;
+
+ return s_aMutex;
}