summaryrefslogtreecommitdiff
path: root/connectivity
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2017-06-12 02:12:56 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-13 09:13:37 +0200
commita3bedb7ae8f23476843e00380aba05002aa1e827 (patch)
tree0eb626a63ebb5d45c7e837def5cca433b96eba56 /connectivity
parente272761e8fca9eccbf6fd5737df2b1aee1730947 (diff)
use local statics for getUnoTunnelImplementationId
replace uses of double checked locking pattern and rtl::Static Change-Id: I479d9d94f652b4fb4c67388405823a5f4e2b6ed4 Reviewed-on: https://gerrit.libreoffice.org/38690 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r--connectivity/source/commontools/ConnectionWrapper.cxx14
-rw-r--r--connectivity/source/commontools/TConnection.cxx14
-rw-r--r--connectivity/source/drivers/ado/AColumn.cxx14
-rw-r--r--connectivity/source/drivers/ado/AConnection.cxx14
-rw-r--r--connectivity/source/drivers/ado/AGroup.cxx14
-rw-r--r--connectivity/source/drivers/ado/AIndex.cxx14
-rw-r--r--connectivity/source/drivers/ado/AKey.cxx14
-rw-r--r--connectivity/source/drivers/ado/ATable.cxx14
-rw-r--r--connectivity/source/drivers/ado/AUser.cxx14
-rw-r--r--connectivity/source/drivers/ado/AView.cxx14
-rw-r--r--connectivity/source/drivers/calc/CTable.cxx14
-rw-r--r--connectivity/source/drivers/dbase/DIndex.cxx14
-rw-r--r--connectivity/source/drivers/dbase/DTable.cxx14
-rw-r--r--connectivity/source/drivers/file/FConnection.cxx14
-rw-r--r--connectivity/source/drivers/file/FResultSet.cxx14
-rw-r--r--connectivity/source/drivers/flat/ETable.cxx14
-rw-r--r--connectivity/source/drivers/hsqldb/HTable.cxx14
-rw-r--r--connectivity/source/drivers/mysql/YTable.cxx14
-rw-r--r--connectivity/source/sdbcx/VDescriptor.cxx14
19 files changed, 57 insertions, 209 deletions
diff --git a/connectivity/source/commontools/ConnectionWrapper.cxx b/connectivity/source/commontools/ConnectionWrapper.cxx
index 9cf55cb1a351..18f0b8cff56a 100644
--- a/connectivity/source/commontools/ConnectionWrapper.cxx
+++ b/connectivity/source/commontools/ConnectionWrapper.cxx
@@ -166,17 +166,9 @@ sal_Int64 SAL_CALL OConnectionWrapper::getSomething( const Sequence< sal_Int8 >&
Sequence< sal_Int8 > OConnectionWrapper::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
namespace
diff --git a/connectivity/source/commontools/TConnection.cxx b/connectivity/source/commontools/TConnection.cxx
index 6853a69fac63..febc53170355 100644
--- a/connectivity/source/commontools/TConnection.cxx
+++ b/connectivity/source/commontools/TConnection.cxx
@@ -65,17 +65,9 @@ sal_Int64 SAL_CALL OMetaConnection::getSomething( const css::uno::Sequence< sal_
Sequence< sal_Int8 > OMetaConnection::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
::dbtools::OPropertyMap& OMetaConnection::getPropMap()
diff --git a/connectivity/source/drivers/ado/AColumn.cxx b/connectivity/source/drivers/ado/AColumn.cxx
index 144a6f16b0b5..34c8b6129180 100644
--- a/connectivity/source/drivers/ado/AColumn.cxx
+++ b/connectivity/source/drivers/ado/AColumn.cxx
@@ -77,17 +77,9 @@ OAdoColumn::OAdoColumn(bool _bCase,OConnection* _pConnection)
Sequence< sal_Int8 > OAdoColumn::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/ado/AConnection.cxx b/connectivity/source/drivers/ado/AConnection.cxx
index bb98b69b7690..cd42068305c4 100644
--- a/connectivity/source/drivers/ado/AConnection.cxx
+++ b/connectivity/source/drivers/ado/AConnection.cxx
@@ -506,17 +506,9 @@ sal_Int64 SAL_CALL OConnection::getSomething( const css::uno::Sequence< sal_Int8
Sequence< sal_Int8 > OConnection::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
const OExtendedTypeInfo* OConnection::getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo,
diff --git a/connectivity/source/drivers/ado/AGroup.cxx b/connectivity/source/drivers/ado/AGroup.cxx
index f8c61dee557a..b9687d7823bc 100644
--- a/connectivity/source/drivers/ado/AGroup.cxx
+++ b/connectivity/source/drivers/ado/AGroup.cxx
@@ -84,17 +84,9 @@ void OAdoGroup::refreshUsers()
Sequence< sal_Int8 > OAdoGroup::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/ado/AIndex.cxx b/connectivity/source/drivers/ado/AIndex.cxx
index b33f57ab3f6a..c4ad0bb22273 100644
--- a/connectivity/source/drivers/ado/AIndex.cxx
+++ b/connectivity/source/drivers/ado/AIndex.cxx
@@ -74,17 +74,9 @@ void OAdoIndex::refreshColumns()
Sequence< sal_Int8 > OAdoIndex::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/ado/AKey.cxx b/connectivity/source/drivers/ado/AKey.cxx
index 2df0c8775a80..f8797f779a85 100644
--- a/connectivity/source/drivers/ado/AKey.cxx
+++ b/connectivity/source/drivers/ado/AKey.cxx
@@ -69,17 +69,9 @@ void OAdoKey::refreshColumns()
Sequence< sal_Int8 > OAdoKey::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/ado/ATable.cxx b/connectivity/source/drivers/ado/ATable.cxx
index 6ef5fb391462..567f660bd72e 100644
--- a/connectivity/source/drivers/ado/ATable.cxx
+++ b/connectivity/source/drivers/ado/ATable.cxx
@@ -126,17 +126,9 @@ void OAdoTable::refreshIndexes()
Sequence< sal_Int8 > OAdoTable::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/ado/AUser.cxx b/connectivity/source/drivers/ado/AUser.cxx
index 447789f6a8fb..30e5d5164607 100644
--- a/connectivity/source/drivers/ado/AUser.cxx
+++ b/connectivity/source/drivers/ado/AUser.cxx
@@ -68,17 +68,9 @@ void OAdoUser::refreshGroups()
Sequence< sal_Int8 > OAdoUser::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/ado/AView.cxx b/connectivity/source/drivers/ado/AView.cxx
index f39e93577597..05c835b86e10 100644
--- a/connectivity/source/drivers/ado/AView.cxx
+++ b/connectivity/source/drivers/ado/AView.cxx
@@ -43,17 +43,9 @@ OAdoView::OAdoView(bool _bCase,ADOView* _pView) : OView_ADO(_bCase,nullptr)
Sequence< sal_Int8 > OAdoView::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx
index 0d31b4b34cd9..0f030b5fbbc0 100644
--- a/connectivity/source/drivers/calc/CTable.cxx
+++ b/connectivity/source/drivers/calc/CTable.cxx
@@ -681,17 +681,9 @@ Any SAL_CALL OCalcTable::queryInterface( const Type & rType )
Sequence< sal_Int8 > OCalcTable::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/dbase/DIndex.cxx b/connectivity/source/drivers/dbase/DIndex.cxx
index f3ec08b0ee44..575b195ca834 100644
--- a/connectivity/source/drivers/dbase/DIndex.cxx
+++ b/connectivity/source/drivers/dbase/DIndex.cxx
@@ -108,17 +108,9 @@ void ODbaseIndex::refreshColumns()
Sequence< sal_Int8 > ODbaseIndex::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// XUnoTunnel
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx
index d19a7bfba257..ec77d68ac17c 100644
--- a/connectivity/source/drivers/dbase/DTable.cxx
+++ b/connectivity/source/drivers/dbase/DTable.cxx
@@ -769,17 +769,9 @@ Any SAL_CALL ODbaseTable::queryInterface( const Type & rType )
Sequence< sal_Int8 > ODbaseTable::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/file/FConnection.cxx b/connectivity/source/drivers/file/FConnection.cxx
index 27d2b2d9ee03..2d654cb49842 100644
--- a/connectivity/source/drivers/file/FConnection.cxx
+++ b/connectivity/source/drivers/file/FConnection.cxx
@@ -414,17 +414,9 @@ sal_Int64 SAL_CALL OConnection::getSomething( const Sequence< sal_Int8 >& rId )
Sequence< sal_Int8 > OConnection::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
void OConnection::throwUrlNotValid(const OUString & _rsUrl,const OUString & _rsMessage)
diff --git a/connectivity/source/drivers/file/FResultSet.cxx b/connectivity/source/drivers/file/FResultSet.cxx
index eabbb78a0cfe..3388c905cd3e 100644
--- a/connectivity/source/drivers/file/FResultSet.cxx
+++ b/connectivity/source/drivers/file/FResultSet.cxx
@@ -1405,17 +1405,9 @@ bool OResultSet::OpenImpl()
Sequence< sal_Int8 > OResultSet::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/flat/ETable.cxx b/connectivity/source/drivers/flat/ETable.cxx
index 06ae56b2fea7..1f0c565c9119 100644
--- a/connectivity/source/drivers/flat/ETable.cxx
+++ b/connectivity/source/drivers/flat/ETable.cxx
@@ -553,17 +553,9 @@ Any SAL_CALL OFlatTable::queryInterface( const Type & rType )
Sequence< sal_Int8 > OFlatTable::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/hsqldb/HTable.cxx b/connectivity/source/drivers/hsqldb/HTable.cxx
index 6ce97cd11b5e..6f0b4188943c 100644
--- a/connectivity/source/drivers/hsqldb/HTable.cxx
+++ b/connectivity/source/drivers/hsqldb/HTable.cxx
@@ -128,17 +128,9 @@ sdbcx::OCollection* OHSQLTable::createIndexes(const TStringVector& _rNames)
Sequence< sal_Int8 > OHSQLTable::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/drivers/mysql/YTable.cxx b/connectivity/source/drivers/mysql/YTable.cxx
index a83c82639559..db9b591ad23e 100644
--- a/connectivity/source/drivers/mysql/YTable.cxx
+++ b/connectivity/source/drivers/mysql/YTable.cxx
@@ -147,17 +147,9 @@ sdbcx::OCollection* OMySQLTable::createIndexes(const TStringVector& _rNames)
Sequence< sal_Int8 > OMySQLTable::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}
// css::lang::XUnoTunnel
diff --git a/connectivity/source/sdbcx/VDescriptor.cxx b/connectivity/source/sdbcx/VDescriptor.cxx
index 511bd2e4f21f..fa0bb3fe2459 100644
--- a/connectivity/source/sdbcx/VDescriptor.cxx
+++ b/connectivity/source/sdbcx/VDescriptor.cxx
@@ -104,17 +104,9 @@ namespace connectivity
Sequence< sal_Int8 > ODescriptor::getUnoTunnelImplementationId()
{
- static ::cppu::OImplementationId * pId = nullptr;
- if (! pId)
- {
- ::osl::MutexGuard aGuard( ::osl::Mutex::getGlobalMutex() );
- if (! pId)
- {
- static ::cppu::OImplementationId aId;
- pId = &aId;
- }
- }
- return pId->getImplementationId();
+ static ::cppu::OImplementationId implId;
+
+ return implId.getImplementationId();
}