From 6149da20ddee5c0c50b445fb6a4e3e81b5ff900b Mon Sep 17 00:00:00 2001 From: Jochen Nitschke Date: Sat, 17 Jun 2017 14:01:36 +0200 Subject: replace misc double checked locking patterns ... with thread safe local statics Change-Id: Ie3c8023776a388846b989f00a0be185273c0d5da Reviewed-on: https://gerrit.libreoffice.org/38907 Tested-by: Jenkins Reviewed-by: Noel Grandin --- stoc/source/javaloader/javaloader.cxx | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'stoc') 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 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 -- cgit