diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-06-17 14:01:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-17 15:43:38 +0200 |
commit | 6149da20ddee5c0c50b445fb6a4e3e81b5ff900b (patch) | |
tree | 7cfca9c16dff522f0c0e15809f9fe4b926078698 /stoc | |
parent | 470752f50c146b449b1c9bdccc36ed031535663c (diff) |
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.cxx | 14 |
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 |