summaryrefslogtreecommitdiff
path: root/dbaccess
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 /dbaccess
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 'dbaccess')
-rw-r--r--dbaccess/source/core/api/RowSet.cxx14
-rw-r--r--dbaccess/source/core/api/TableDeco.cxx14
-rw-r--r--dbaccess/source/core/dataaccess/databasecontext.cxx14
-rw-r--r--dbaccess/source/ui/querydesign/JoinExchange.cxx14
4 files changed, 12 insertions, 44 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index c78d8c961481..573f9cf14157 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -2948,17 +2948,9 @@ void ORowSetClone::close()
Sequence< sal_Int8 > ORowSetClone::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::XUnoTunnel
diff --git a/dbaccess/source/core/api/TableDeco.cxx b/dbaccess/source/core/api/TableDeco.cxx
index 02e83ef1b336..fb747850163b 100644
--- a/dbaccess/source/core/api/TableDeco.cxx
+++ b/dbaccess/source/core/api/TableDeco.cxx
@@ -476,17 +476,9 @@ sal_Int64 SAL_CALL ODBTableDecorator::getSomething( const Sequence< sal_Int8 >&
Sequence< sal_Int8 > ODBTableDecorator::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 ODBTableDecorator::fillPrivileges() const
diff --git a/dbaccess/source/core/dataaccess/databasecontext.cxx b/dbaccess/source/core/dataaccess/databasecontext.cxx
index a29f9971e73a..7f6ac225a0b1 100644
--- a/dbaccess/source/core/dataaccess/databasecontext.cxx
+++ b/dbaccess/source/core/dataaccess/databasecontext.cxx
@@ -726,17 +726,9 @@ sal_Int64 SAL_CALL ODatabaseContext::getSomething( const Sequence< sal_Int8 >& r
Sequence< sal_Int8 > ODatabaseContext::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 ODatabaseContext::onBasicManagerCreated( const Reference< XModel >& _rxForDocument, BasicManager& _rBasicManager )
diff --git a/dbaccess/source/ui/querydesign/JoinExchange.cxx b/dbaccess/source/ui/querydesign/JoinExchange.cxx
index 2214a4e8b8b0..1d027c04afda 100644
--- a/dbaccess/source/ui/querydesign/JoinExchange.cxx
+++ b/dbaccess/source/ui/querydesign/JoinExchange.cxx
@@ -83,17 +83,9 @@ namespace dbaui
Sequence< sal_Int8 > OJoinExchObj::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();
}
sal_Int64 SAL_CALL OJoinExchObj::getSomething( const Sequence< sal_Int8 >& _rIdentifier )