diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-06-11 13:37:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-12 08:45:18 +0200 |
commit | 0b8c2c72c988488895d74d1bb36e60378283a4da (patch) | |
tree | 2edaa17af0c5bdf60969e6e0208b00fba52eb11e /include/ucbhelper | |
parent | clang-tidy readability-delete-null-pointer (diff) | |
download | core-0b8c2c72c988488895d74d1bb36e60378283a4da.tar.gz core-0b8c2c72c988488895d74d1bb36e60378283a4da.zip |
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/ucbhelper')
-rw-r--r-- | include/ucbhelper/macros.hxx | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/include/ucbhelper/macros.hxx b/include/ucbhelper/macros.hxx index 09dca56d5750..6be773977867 100644 --- a/include/ucbhelper/macros.hxx +++ b/include/ucbhelper/macros.hxx @@ -48,20 +48,13 @@ Class::getImplementationId() \ css::uno::Sequence< css::uno::Type > SAL_CALL \ Class::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( + #define GETTYPES_IMPL_END \ ); \ - pCollection = &collection; \ - } \ - } \ - return (*pCollection).getTypes(); \ + \ + return collection.getTypes(); \ } |