summaryrefslogtreecommitdiffstats
path: root/stoc
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-06-17 14:01:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-17 15:43:38 +0200
commit6149da20ddee5c0c50b445fb6a4e3e81b5ff900b (patch)
tree7cfca9c16dff522f0c0e15809f9fe4b926078698 /stoc
parentcreate o3tl::array_view (diff)
downloadcore-6149da20ddee5c0c50b445fb6a4e3e81b5ff900b.tar.gz
core-6149da20ddee5c0c50b445fb6a4e3e81b5ff900b.zip
replace misc double checked locking patterns
... with thread safe local statics Change-Id: Ie3c8023776a388846b989f00a0be185273c0d5da Reviewed-on: https://gerrit.libreoffice.org/38907 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'stoc')
-rw-r--r--stoc/source/javaloader/javaloader.cxx14
1 files changed, 3 insertions, 11 deletions
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index db850bdb5e6a..01000b0ab827 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -330,17 +330,9 @@ css::uno::Reference<XInterface> SAL_CALL JavaComponentLoader::activate(
static Mutex & getInitMutex()
{
- static Mutex * pMutex = nullptr;
- if( ! pMutex )
- {
- MutexGuard guard( Mutex::getGlobalMutex() );
- if( ! pMutex )
- {
- static Mutex mutex;
- pMutex = &mutex;
- }
- }
- return *pMutex;
+ static Mutex ourMutex;
+
+ return ourMutex;
}
/// @throws Exception