summaryrefslogtreecommitdiff
path: root/package
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-11-04 20:31:58 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-11-05 13:26:36 +0100
commite07253e0262a11dc96a98598c55c43da16b9678a (patch)
tree5e803be171a4ec248ed5053258e3ea9d0a0f0e81 /package
parent212ea275f21251903e449ba5a6b7c4fc2dc57642 (diff)
replace double-checked locking patterns with thread safe local statics
Change-Id: I4ed97cc6d9f733292156d71551d5ce3af6071445 Reviewed-on: https://gerrit.libreoffice.org/62858 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'package')
-rw-r--r--package/source/xstor/oseekinstream.cxx19
1 files changed, 3 insertions, 16 deletions
diff --git a/package/source/xstor/oseekinstream.cxx b/package/source/xstor/oseekinstream.cxx
index 34d6a5d8f480..d19d6a745ab1 100644
--- a/package/source/xstor/oseekinstream.cxx
+++ b/package/source/xstor/oseekinstream.cxx
@@ -53,23 +53,10 @@ OInputSeekStream::~OInputSeekStream()
uno::Sequence< uno::Type > SAL_CALL OInputSeekStream::getTypes()
{
- static ::cppu::OTypeCollection* pTypeCollection = nullptr ;
+ static cppu::OTypeCollection aTypeCollection(cppu::UnoType<io::XSeekable>::get(),
+ OInputCompStream::getTypes());
- if ( pTypeCollection == nullptr )
- {
- ::osl::MutexGuard aGuard( m_xMutex->GetMutex() ) ;
-
- if ( pTypeCollection == nullptr )
- {
- static ::cppu::OTypeCollection aTypeCollection(
- cppu::UnoType<io::XSeekable>::get(),
- OInputCompStream::getTypes() );
-
- pTypeCollection = &aTypeCollection ;
- }
- }
-
- return pTypeCollection->getTypes() ;
+ return aTypeCollection.getTypes();
}
uno::Any SAL_CALL OInputSeekStream::queryInterface( const uno::Type& rType )