summaryrefslogtreecommitdiff
path: root/include/toolkit
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-06-11 13:37:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-12 08:45:18 +0200
commit0b8c2c72c988488895d74d1bb36e60378283a4da (patch)
tree2edaa17af0c5bdf60969e6e0208b00fba52eb11e /include/toolkit
parente4e4d5713e248f02faf7aa6199b11e152973de8e (diff)
replace double checked locking patterns in getTypes macros
with thread safe local statics Change-Id: Ie7c44fb35ba0b24e154631a4805463230e2c69e7 Reviewed-on: https://gerrit.libreoffice.org/38662 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/toolkit')
-rw-r--r--include/toolkit/helper/macros.hxx14
1 files changed, 2 insertions, 12 deletions
diff --git a/include/toolkit/helper/macros.hxx b/include/toolkit/helper/macros.hxx
index ab9b0f4b3739..25c3e3d4c33f 100644
--- a/include/toolkit/helper/macros.hxx
+++ b/include/toolkit/helper/macros.hxx
@@ -60,22 +60,12 @@ css::uno::Sequence< sal_Int8 > ClassName::getImplementationId() \
IMPL_IMPLEMENTATION_ID( ClassName ) \
css::uno::Sequence< css::uno::Type > ClassName::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 collection( \
cppu::UnoType<css::lang::XTypeProvider>::get(),
-
#define IMPL_XTYPEPROVIDER_END \
); \
- pCollection = &collection; \
- } \
- } \
- return (*pCollection).getTypes(); \
+ return collection.getTypes(); \
}