summaryrefslogtreecommitdiff
path: root/scripting/source/dlgprov
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2018-10-08 16:32:04 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-08 19:51:24 +0200
commit9ed8a1bfffd608b31badeae5341ebf0b48501419 (patch)
treec0ed025295bdde4eb960aa522fecc87a60b4000d /scripting/source/dlgprov
parent110781a3a27dffe9e6690839bdce993796a08331 (diff)
replace double-checked locking patterns with thread safe ...
local statics. Change-Id: Iab4963a04d15f06e9b1a36079a36d32453e09c8f Reviewed-on: https://gerrit.libreoffice.org/61538 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'scripting/source/dlgprov')
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx14
1 files changed, 3 insertions, 11 deletions
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;
}