summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorJochen Nitschke <j.nitschke+logerrit@ok.de>2018-07-29 18:22:19 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-29 23:05:31 +0200
commit1eeb8d34760e63c0ab2b52a27f43141bcde84297 (patch)
tree8b7d4f6455ad497425727f7f855ad774de619375 /dbaccess
parent3c28c44a7acc42e89b4012557ca7e51a870043c8 (diff)
replace double checked locking patterns
with thread safe static initialization Change-Id: I7b102e8a6aec64b0795f5fa915276ffc1f568d0a Reviewed-on: https://gerrit.libreoffice.org/58288 Tested-by: Jenkins 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/table.cxx14
2 files changed, 6 insertions, 22 deletions
diff --git a/dbaccess/source/core/api/RowSet.cxx b/dbaccess/source/core/api/RowSet.cxx
index 0ce715ed1a8a..69414a73b34f 100644
--- a/dbaccess/source/core/api/RowSet.cxx
+++ b/dbaccess/source/core/api/RowSet.cxx
@@ -456,17 +456,9 @@ sal_Int64 SAL_CALL ORowSet::getSomething( const Sequence< sal_Int8 >& rId )
Sequence< sal_Int8 > ORowSet::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 s_Id;
+
+ return s_Id.getImplementationId();
}
// css::XAggregation
diff --git a/dbaccess/source/core/api/table.cxx b/dbaccess/source/core/api/table.cxx
index 3590e93613aa..348c61ded3ac 100644
--- a/dbaccess/source/core/api/table.cxx
+++ b/dbaccess/source/core/api/table.cxx
@@ -312,17 +312,9 @@ sal_Int64 SAL_CALL ODBTable::getSomething( const Sequence< sal_Int8 >& rId )
Sequence< sal_Int8 > ODBTable::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 s_Id;
+
+ return s_Id.getImplementationId();
}
Reference< XPropertySet > ODBTable::createColumnDescriptor()