diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-06-06 11:02:09 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-06 20:58:18 +0200 |
commit | cbcaff7510d557d345c15db97f52633c81939d41 (patch) | |
tree | 745ebaa1a384a290bd408288f542e356a20f9027 /ucbhelper/source/provider/simplenameclashresolverequest.cxx | |
parent | ca8a4a7abc81a53a88fc0daa61447f9562f532f5 (diff) |
ucb: replace double checked locking patterns
with thread safe local statics
and prefix statics
Change-Id: Iaa7c9056847f75612d6cf6c6e44d3896fca734de
Reviewed-on: https://gerrit.libreoffice.org/38433
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'ucbhelper/source/provider/simplenameclashresolverequest.cxx')
-rw-r--r-- | ucbhelper/source/provider/simplenameclashresolverequest.cxx | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/ucbhelper/source/provider/simplenameclashresolverequest.cxx b/ucbhelper/source/provider/simplenameclashresolverequest.cxx index cd94391ad8c5..668b512ab10d 100644 --- a/ucbhelper/source/provider/simplenameclashresolverequest.cxx +++ b/ucbhelper/source/provider/simplenameclashresolverequest.cxx @@ -105,19 +105,11 @@ uno::Sequence< sal_Int8 > SAL_CALL InteractionSupplyName::getImplementationId() uno::Sequence< uno::Type > SAL_CALL InteractionSupplyName::getTypes() { - static cppu::OTypeCollection* pCollection = nullptr; - if ( !pCollection ) - { - osl::Guard< osl::Mutex > aGuard( osl::Mutex::getGlobalMutex() ); - if ( !pCollection ) - { - static cppu::OTypeCollection collection( + static cppu::OTypeCollection s_aCollection( cppu::UnoType<lang::XTypeProvider>::get(), cppu::UnoType<ucb::XInteractionSupplyName>::get() ); - pCollection = &collection; - } - } - return (*pCollection).getTypes(); + + return s_aCollection.getTypes(); } void SAL_CALL InteractionSupplyName::select() |