[Libreoffice-commits] core.git: comphelper/source connectivity/Library_postgresql-sdbc-impl.mk connectivity/Library_postgresql-sdbc.mk connectivity/source include/comphelper package/inc package/Library_xstor.mk package/source

Noel Grandin noel.grandin at collabora.co.uk
Tue Jun 20 12:13:59 UTC 2017


 comphelper/source/misc/sharedmutex.cxx                                 |    5 
 connectivity/Library_postgresql-sdbc-impl.mk                           |    1 
 connectivity/Library_postgresql-sdbc.mk                                |    1 
 connectivity/source/drivers/postgresql/pq_array.cxx                    |    2 
 connectivity/source/drivers/postgresql/pq_array.hxx                    |    6 
 connectivity/source/drivers/postgresql/pq_baseresultset.cxx            |   58 +--
 connectivity/source/drivers/postgresql/pq_baseresultset.hxx            |    4 
 connectivity/source/drivers/postgresql/pq_connection.cxx               |   42 +-
 connectivity/source/drivers/postgresql/pq_connection.hxx               |   12 
 connectivity/source/drivers/postgresql/pq_databasemetadata.cxx         |   62 +--
 connectivity/source/drivers/postgresql/pq_databasemetadata.hxx         |    4 
 connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx |    2 
 connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx |    2 
 connectivity/source/drivers/postgresql/pq_preparedstatement.cxx        |   36 -
 connectivity/source/drivers/postgresql/pq_preparedstatement.hxx        |    4 
 connectivity/source/drivers/postgresql/pq_resultset.cxx                |   10 
 connectivity/source/drivers/postgresql/pq_resultset.hxx                |    2 
 connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx        |   18 
 connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx        |    4 
 connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx        |    2 
 connectivity/source/drivers/postgresql/pq_sequenceresultset.hxx        |    2 
 connectivity/source/drivers/postgresql/pq_statement.cxx                |   16 
 connectivity/source/drivers/postgresql/pq_statement.hxx                |    6 
 connectivity/source/drivers/postgresql/pq_updateableresultset.cxx      |   24 -
 connectivity/source/drivers/postgresql/pq_updateableresultset.hxx      |    4 
 connectivity/source/drivers/postgresql/pq_xbase.cxx                    |    8 
 connectivity/source/drivers/postgresql/pq_xbase.hxx                    |    4 
 connectivity/source/drivers/postgresql/pq_xcolumn.cxx                  |    8 
 connectivity/source/drivers/postgresql/pq_xcolumn.hxx                  |    4 
 connectivity/source/drivers/postgresql/pq_xcolumns.cxx                 |   30 -
 connectivity/source/drivers/postgresql/pq_xcolumns.hxx                 |    6 
 connectivity/source/drivers/postgresql/pq_xcontainer.cxx               |   14 
 connectivity/source/drivers/postgresql/pq_xcontainer.hxx               |    4 
 connectivity/source/drivers/postgresql/pq_xindex.cxx                   |   14 
 connectivity/source/drivers/postgresql/pq_xindex.hxx                   |    4 
 connectivity/source/drivers/postgresql/pq_xindexcolumn.cxx             |    8 
 connectivity/source/drivers/postgresql/pq_xindexcolumn.hxx             |    4 
 connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx            |   20 -
 connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx            |    8 
 connectivity/source/drivers/postgresql/pq_xindexes.cxx                 |   18 
 connectivity/source/drivers/postgresql/pq_xindexes.hxx                 |    8 
 connectivity/source/drivers/postgresql/pq_xkey.cxx                     |   12 
 connectivity/source/drivers/postgresql/pq_xkey.hxx                     |    4 
 connectivity/source/drivers/postgresql/pq_xkeycolumn.cxx               |    8 
 connectivity/source/drivers/postgresql/pq_xkeycolumn.hxx               |    4 
 connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx              |   18 
 connectivity/source/drivers/postgresql/pq_xkeycolumns.hxx              |    6 
 connectivity/source/drivers/postgresql/pq_xkeys.cxx                    |   20 -
 connectivity/source/drivers/postgresql/pq_xkeys.hxx                    |    8 
 connectivity/source/drivers/postgresql/pq_xtable.cxx                   |   22 -
 connectivity/source/drivers/postgresql/pq_xtable.hxx                   |    4 
 connectivity/source/drivers/postgresql/pq_xtables.cxx                  |   14 
 connectivity/source/drivers/postgresql/pq_xtables.hxx                  |    4 
 connectivity/source/drivers/postgresql/pq_xuser.cxx                    |    8 
 connectivity/source/drivers/postgresql/pq_xuser.hxx                    |    4 
 connectivity/source/drivers/postgresql/pq_xusers.cxx                   |   14 
 connectivity/source/drivers/postgresql/pq_xusers.hxx                   |    4 
 connectivity/source/drivers/postgresql/pq_xview.cxx                    |   10 
 connectivity/source/drivers/postgresql/pq_xview.hxx                    |    4 
 connectivity/source/drivers/postgresql/pq_xviews.cxx                   |   14 
 connectivity/source/drivers/postgresql/pq_xviews.hxx                   |    4 
 include/comphelper/refcountedmutex.hxx                                 |   33 -
 package/Library_xstor.mk                                               |    1 
 package/inc/ZipFile.hxx                                                |   21 -
 package/inc/ZipPackage.hxx                                             |    6 
 package/inc/ZipPackageStream.hxx                                       |    2 
 package/inc/zipfileaccess.hxx                                          |    5 
 package/source/xstor/ocompinstream.cxx                                 |   66 +--
 package/source/xstor/ocompinstream.hxx                                 |    5 
 package/source/xstor/oseekinstream.cxx                                 |    8 
 package/source/xstor/owriteablestream.cxx                              |  145 +++----
 package/source/xstor/owriteablestream.hxx                              |   13 
 package/source/xstor/xstorage.cxx                                      |  186 +++++-----
 package/source/xstor/xstorage.hxx                                      |    6 
 package/source/zipapi/XUnbufferedStream.cxx                            |    4 
 package/source/zipapi/XUnbufferedStream.hxx                            |    8 
 package/source/zipapi/ZipFile.cxx                                      |   16 
 package/source/zippackage/ZipPackage.cxx                               |    2 
 package/source/zippackage/wrapstreamforshare.cxx                       |   18 
 package/source/zippackage/wrapstreamforshare.hxx                       |    8 
 package/source/zippackage/zipfileaccess.cxx                            |    2 
 81 files changed, 610 insertions(+), 622 deletions(-)

New commits:
commit 809e2d33b45b54b4438a4c55aed93efd73d2aa49
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Mon Jun 19 17:06:34 2017 +0200

    create comphelper::RefCountedMutex
    
    and merge the two existing implementations of the idea - SotMutexHolder
    from package and RefCountedMutex from connectivity
    
    Change-Id: I87f09f359ac798cf934381a2c75225dab71dd43e
    Reviewed-on: https://gerrit.libreoffice.org/38972
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/comphelper/source/misc/sharedmutex.cxx b/comphelper/source/misc/sharedmutex.cxx
index 21188c3cfe01..e53e2700d76f 100644
--- a/comphelper/source/misc/sharedmutex.cxx
+++ b/comphelper/source/misc/sharedmutex.cxx
@@ -19,6 +19,7 @@
 
 
 #include <comphelper/sharedmutex.hxx>
+#include <comphelper/refcountedmutex.hxx>
 
 
 namespace comphelper
@@ -43,6 +44,10 @@ namespace comphelper
         return *this;
     }
 
+    RefCountedMutex::~RefCountedMutex()
+    {
+    }
+
 
 } // namespace comphelper
 
diff --git a/connectivity/Library_postgresql-sdbc-impl.mk b/connectivity/Library_postgresql-sdbc-impl.mk
index 2ff0b635b890..53cebd01a242 100644
--- a/connectivity/Library_postgresql-sdbc-impl.mk
+++ b/connectivity/Library_postgresql-sdbc-impl.mk
@@ -20,6 +20,7 @@ $(eval $(call gb_Library_set_precompiled_header,postgresql-sdbc-impl,$(SRCDIR)/c
 $(eval $(call gb_Library_use_sdk_api,postgresql-sdbc-impl))
 
 $(eval $(call gb_Library_use_libraries,postgresql-sdbc-impl,\
+	comphelper \
 	cppu \
 	cppuhelper \
 	dbtools \
diff --git a/connectivity/Library_postgresql-sdbc.mk b/connectivity/Library_postgresql-sdbc.mk
index 8f7efcd02995..48613ab91bfc 100644
--- a/connectivity/Library_postgresql-sdbc.mk
+++ b/connectivity/Library_postgresql-sdbc.mk
@@ -22,6 +22,7 @@ $(eval $(call gb_Library_use_libraries,postgresql-sdbc,\
 	cppu \
 	cppuhelper \
 	sal \
+	salhelper \
 ))
 
 $(eval $(call gb_Library_set_componentfile,postgresql-sdbc,connectivity/source/drivers/postgresql/postgresql-sdbc))
diff --git a/connectivity/source/drivers/postgresql/pq_array.cxx b/connectivity/source/drivers/postgresql/pq_array.cxx
index 77b509bd641d..d89fe00f4ca6 100644
--- a/connectivity/source/drivers/postgresql/pq_array.cxx
+++ b/connectivity/source/drivers/postgresql/pq_array.cxx
@@ -102,7 +102,7 @@ css::uno::Reference< css::sdbc::XResultSet > Array::getResultSetAtIndex(
     }
 
     return new SequenceResultSet(
-        m_refMutex, m_owner, getStatics().resultSetArrayColumnNames, ret, m_tc );
+        m_xMutex, m_owner, getStatics().resultSetArrayColumnNames, ret, m_tc );
 }
 
 
diff --git a/connectivity/source/drivers/postgresql/pq_array.hxx b/connectivity/source/drivers/postgresql/pq_array.hxx
index 41f5ee9f7056..c0ed6aa97efd 100644
--- a/connectivity/source/drivers/postgresql/pq_array.hxx
+++ b/connectivity/source/drivers/postgresql/pq_array.hxx
@@ -50,18 +50,18 @@ class Array : public cppu::WeakImplHelper< css::sdbc::XArray >
     std::vector< css::uno::Any > m_data;
     css::uno::Reference< css::uno::XInterface > m_owner;
     css::uno::Reference< css::script::XTypeConverter > m_tc;
-    rtl::Reference< RefCountedMutex > m_refMutex;
+    rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
 
 public:
     Array(
-        const rtl::Reference< RefCountedMutex > & mutex,
+        const rtl::Reference< comphelper::RefCountedMutex > & mutex,
         const std::vector< css::uno::Any > & data,
         const css::uno::Reference< css::uno::XInterface > & owner,
         const css::uno::Reference< css::script::XTypeConverter > &tc) :
         m_data( data ),
         m_owner( owner ),
         m_tc( tc ),
-        m_refMutex( mutex )
+        m_xMutex( mutex )
     {}
 
 public: // XArray
diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
index 3d96f771e346..2c7498271cb9 100644
--- a/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_baseresultset.cxx
@@ -126,16 +126,16 @@ static ::cppu::IPropertyArrayHelper & getResultSetPropertyArrayHelper()
 }
 
 BaseResultSet::BaseResultSet(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const Reference< XInterface > & owner,
     sal_Int32 rowCount,
     sal_Int32 colCount,
     const Reference< css::script::XTypeConverter > & tc )
-    : BaseResultSet_BASE( refMutex->mutex )
+    : BaseResultSet_BASE( refMutex->GetMutex() )
     , OPropertySetHelper( BaseResultSet_BASE::rBHelper )
     , m_owner( owner )
     , m_tc( tc )
-    , m_refMutex( refMutex )
+    , m_xMutex( refMutex )
     , m_row( -1 )
     , m_rowCount( rowCount )
     , m_fieldCount( colCount )
@@ -144,7 +144,7 @@ BaseResultSet::BaseResultSet(
     POSTGRE_TRACE( "ctor BaseResultSet" );
 }
 
-// LEM TODO: refMutex->mutex should live longer than OComponentHelper,
+// LEM TODO: refMutex->GetMutex() should live longer than OComponentHelper,
 // but calling OComponentHelper::dispose explicitly here calls
 // BaseResultSet::~BaseResultSet in an infinite loop :(
 BaseResultSet::~BaseResultSet()
@@ -201,12 +201,12 @@ Sequence< sal_Int8> BaseResultSet::getImplementationId()
 // {
 //     ResultSetGuard guard(*this);
 //     checkClosed();
-//     return new ResultSetMetaData( m_refMutex, this, &m_result );
+//     return new ResultSetMetaData( m_xMutex, this, &m_result );
 // }
 
 sal_Bool BaseResultSet::next(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     m_row ++;
     return m_row < m_rowCount;
@@ -214,49 +214,49 @@ sal_Bool BaseResultSet::next(  )
 
 sal_Bool BaseResultSet::isBeforeFirst(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     return m_row == -1;
 }
 
 sal_Bool BaseResultSet::isAfterLast(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     return m_row >= m_rowCount;
 }
 
 sal_Bool BaseResultSet::isFirst(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     return m_row == 0 && m_rowCount;
 }
 
 sal_Bool BaseResultSet::isLast(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     return m_row >= 0 && m_row + 1 == m_rowCount;
 }
 
 void BaseResultSet::beforeFirst(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     m_row = -1;
 }
 
 void BaseResultSet::afterLast(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     m_row = m_rowCount;
 }
 
 sal_Bool BaseResultSet::first(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     bool bRet = ( m_rowCount > 0 );
     if( bRet )
@@ -266,7 +266,7 @@ sal_Bool BaseResultSet::first(  )
 
 sal_Bool BaseResultSet::last(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     bool bRet = ( m_rowCount > 0 );
     if( bRet )
@@ -276,14 +276,14 @@ sal_Bool BaseResultSet::last(  )
 
 sal_Int32 BaseResultSet::getRow(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     return m_row +1;
 }
 
 sal_Bool BaseResultSet::absolute( sal_Int32 row )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     if( row > 0 )
     {
@@ -302,7 +302,7 @@ sal_Bool BaseResultSet::absolute( sal_Int32 row )
 
 sal_Bool BaseResultSet::relative( sal_Int32 rows )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     m_row += rows;
 
@@ -315,7 +315,7 @@ sal_Bool BaseResultSet::relative( sal_Int32 rows )
 
 sal_Bool BaseResultSet::previous(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     bool bRet = ( m_row != -1 );
     if( bRet )
@@ -345,7 +345,7 @@ sal_Bool BaseResultSet::rowDeleted(  )
 
 Reference< XInterface > BaseResultSet::getStatement()
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     return m_owner;
 }
@@ -374,7 +374,7 @@ Any BaseResultSet::convertTo( const Any & val , const Type & type )
 
 sal_Bool BaseResultSet::getBoolean( sal_Int32 columnIndex )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( columnIndex );
     checkRowIndex();
@@ -399,7 +399,7 @@ sal_Bool BaseResultSet::getBoolean( sal_Int32 columnIndex )
 
 sal_Int8 BaseResultSet::getByte( sal_Int32 columnIndex )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( columnIndex );
     checkRowIndex();
@@ -410,7 +410,7 @@ sal_Int8 BaseResultSet::getByte( sal_Int32 columnIndex )
 
 sal_Int16 BaseResultSet::getShort( sal_Int32 columnIndex )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( columnIndex );
     checkRowIndex();
@@ -421,7 +421,7 @@ sal_Int16 BaseResultSet::getShort( sal_Int32 columnIndex )
 
 OUString BaseResultSet::getString( sal_Int32 columnIndex )
 {
-    MutexGuard guard(m_refMutex->mutex);
+    MutexGuard guard(m_xMutex->GetMutex());
     checkClosed();
     checkColumnIndex( columnIndex );
     checkRowIndex();
@@ -433,7 +433,7 @@ OUString BaseResultSet::getString( sal_Int32 columnIndex )
 
 sal_Int32 BaseResultSet::getInt( sal_Int32 columnIndex )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( columnIndex );
     checkRowIndex();
@@ -444,7 +444,7 @@ sal_Int32 BaseResultSet::getInt( sal_Int32 columnIndex )
 
 sal_Int64 BaseResultSet::getLong( sal_Int32 columnIndex )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( columnIndex );
     checkRowIndex();
@@ -455,7 +455,7 @@ sal_Int64 BaseResultSet::getLong( sal_Int32 columnIndex )
 
 float BaseResultSet::getFloat( sal_Int32 columnIndex )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( columnIndex );
     checkRowIndex();
@@ -466,7 +466,7 @@ float BaseResultSet::getFloat( sal_Int32 columnIndex )
 
 double BaseResultSet::getDouble( sal_Int32 columnIndex )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( columnIndex );
     double d = 0.;
@@ -476,7 +476,7 @@ double BaseResultSet::getDouble( sal_Int32 columnIndex )
 
 Sequence< sal_Int8 > BaseResultSet::getBytes( sal_Int32 columnIndex )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( columnIndex );
     checkRowIndex();
@@ -550,7 +550,7 @@ Reference< css::sdbc::XClob > BaseResultSet::getClob( sal_Int32 /* columnIndex *
 
 Reference< css::sdbc::XArray > BaseResultSet::getArray( sal_Int32 columnIndex )
 {
-    return new Array( m_refMutex, parseArray( getString( columnIndex ) ), *this, m_tc );
+    return new Array( m_xMutex, parseArray( getString( columnIndex ) ), *this, m_tc );
 }
 
 ::cppu::IPropertyArrayHelper & BaseResultSet::getInfoHelper()
diff --git a/connectivity/source/drivers/postgresql/pq_baseresultset.hxx b/connectivity/source/drivers/postgresql/pq_baseresultset.hxx
index 2ac107c1925a..27ec2e62a5f1 100644
--- a/connectivity/source/drivers/postgresql/pq_baseresultset.hxx
+++ b/connectivity/source/drivers/postgresql/pq_baseresultset.hxx
@@ -72,7 +72,7 @@ protected:
     css::uno::Any m_props[BASERESULTSET_SIZE];
     css::uno::Reference< css::uno::XInterface > m_owner;
     css::uno::Reference< css::script::XTypeConverter > m_tc;
-    ::rtl::Reference< RefCountedMutex > m_refMutex;
+    ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
     sal_Int32 m_row;
     sal_Int32 m_rowCount;
     sal_Int32 m_fieldCount;
@@ -96,7 +96,7 @@ protected:
 
 protected:
     BaseResultSet(
-        const ::rtl::Reference< RefCountedMutex > & mutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & mutex,
         const css::uno::Reference< css::uno::XInterface > &owner,
         sal_Int32 rowCount,
         sal_Int32 columnCount,
diff --git a/connectivity/source/drivers/postgresql/pq_connection.cxx b/connectivity/source/drivers/postgresql/pq_connection.cxx
index fff200b205b5..f996fa6034fb 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.cxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.cxx
@@ -159,11 +159,11 @@ static LogLevel readLogLevelFromConfiguration()
 }
 
 Connection::Connection(
-    const rtl::Reference< RefCountedMutex > &refMutex,
+    const rtl::Reference< comphelper::RefCountedMutex > &refMutex,
     const css::uno::Reference< css::uno::XComponentContext > & ctx )
-    : ConnectionBase( refMutex->mutex ),
+    : ConnectionBase( refMutex->GetMutex() ),
       m_ctx( ctx ) ,
-      m_refMutex( refMutex )
+      m_xMutex( refMutex )
 {
     m_settings.m_nLogLevel = readLogLevelFromConfiguration();
 
@@ -205,7 +205,7 @@ void Connection::close()
     CloseableList lst;
     DisposeableList lstDispose;
     {
-        MutexGuard guard( m_refMutex->mutex );
+        MutexGuard guard( m_xMutex->GetMutex() );
         // silently ignore, if the connection has been closed already
         if( m_settings.pConnection )
         {
@@ -248,7 +248,7 @@ void Connection::close()
 void Connection::removeFromWeakMap( const ::rtl::ByteSequence & id )
 {
     // shrink the list !
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     WeakHashMap::iterator ii = m_myStatements.find( id );
     if( ii != m_myStatements.end() )
         m_myStatements.erase( ii );
@@ -256,10 +256,10 @@ void Connection::removeFromWeakMap( const ::rtl::ByteSequence & id )
 
 Reference< XStatement > Connection::createStatement()
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
 
-    Statement *stmt = new Statement( m_refMutex, this , &m_settings );
+    Statement *stmt = new Statement( m_xMutex, this , &m_settings );
     Reference< XStatement > ret( stmt );
     ::rtl::ByteSequence id( 16 );
     rtl_createUuid( reinterpret_cast<sal_uInt8*>(id.getArray()), nullptr, false );
@@ -270,11 +270,11 @@ Reference< XStatement > Connection::createStatement()
 
 Reference< XPreparedStatement > Connection::prepareStatement( const OUString& sql )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
 
     OString byteSql = OUStringToOString( sql, ConnectionSettings::encoding );
-    PreparedStatement *stmt = new PreparedStatement( m_refMutex, this, &m_settings, byteSql );
+    PreparedStatement *stmt = new PreparedStatement( m_xMutex, this, &m_settings, byteSql );
     Reference< XPreparedStatement > ret = stmt;
 
     ::rtl::ByteSequence id( 16 );
@@ -325,10 +325,10 @@ sal_Bool Connection::isClosed()
 
 Reference< XDatabaseMetaData > Connection::getMetaData()
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     if( ! m_meta.is() )
-        m_meta = new DatabaseMetaData( m_refMutex, this, &m_settings );
+        m_meta = new DatabaseMetaData( m_xMutex, this, &m_settings );
     return m_meta;
 }
 
@@ -351,7 +351,7 @@ void Connection::setCatalog( const OUString& )
 
 OUString Connection::getCatalog()
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     if( m_settings.pConnection == nullptr )
     {
         throw SQLException( "pq_connection: connection is closed", *this,
@@ -376,7 +376,7 @@ Reference< XNameAccess > Connection::getTypeMap()
 {
     Reference< XNameAccess > t;
     {
-        MutexGuard guard( m_refMutex->mutex );
+        MutexGuard guard( m_xMutex->GetMutex() );
         t = m_typeMap;
     }
     return t;
@@ -384,7 +384,7 @@ Reference< XNameAccess > Connection::getTypeMap()
 
 void Connection::setTypeMap( const Reference< XNameAccess >& typeMap )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     m_typeMap = typeMap;
 }
 Any Connection::getWarnings()
@@ -603,9 +603,9 @@ Reference< XNameAccess > Connection::getTables()
     {
         log(&m_settings, LogLevel::Info, "Connection::getTables() got called");
     }
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     if( !m_settings.tables.is() )
-        m_settings.tables = Tables::create( m_refMutex, this, &m_settings , &m_settings.pTablesImpl);
+        m_settings.tables = Tables::create( m_xMutex, this, &m_settings , &m_settings.pTablesImpl);
     else
         // TODO: how to overcome the performance problem ?
         Reference< css::util::XRefreshable > ( m_settings.tables, UNO_QUERY )->refresh();
@@ -618,9 +618,9 @@ Reference< XNameAccess > Connection::getViews()
     {
         log(&m_settings, LogLevel::Info, "Connection::getViews() got called");
     }
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     if( !m_settings.views.is() )
-        m_settings.views = Views::create( m_refMutex, this, &m_settings, &(m_settings.pViewsImpl) );
+        m_settings.views = Views::create( m_xMutex, this, &m_settings, &(m_settings.pViewsImpl) );
     else
         // TODO: how to overcome the performance problem ?
         Reference< css::util::XRefreshable > ( m_settings.views, UNO_QUERY )->refresh();
@@ -635,9 +635,9 @@ Reference< XNameAccess > Connection::getUsers()
         log(&m_settings, LogLevel::Info, "Connection::getUsers() got called");
     }
 
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     if( !m_settings.users.is() )
-        m_settings.users = Users::create( m_refMutex, this, &m_settings );
+        m_settings.users = Users::create( m_xMutex, this, &m_settings );
     return m_settings.users;
 }
 
@@ -645,7 +645,7 @@ Reference< XNameAccess > Connection::getUsers()
 Reference< XInterface >  ConnectionCreateInstance(
     const Reference< XComponentContext > & ctx )
 {
-    ::rtl::Reference< RefCountedMutex > ref = new RefCountedMutex;
+    ::rtl::Reference< comphelper::RefCountedMutex > ref = new comphelper::RefCountedMutex;
     return * new Connection( ref, ctx );
 }
 
diff --git a/connectivity/source/drivers/postgresql/pq_connection.hxx b/connectivity/source/drivers/postgresql/pq_connection.hxx
index 06bc37e0cb12..f3b33009d050 100644
--- a/connectivity/source/drivers/postgresql/pq_connection.hxx
+++ b/connectivity/source/drivers/postgresql/pq_connection.hxx
@@ -52,7 +52,7 @@
 #include <rtl/ref.hxx>
 #include <rtl/byteseq.hxx>
 
-#include <salhelper/simplereferenceobject.hxx>
+#include <comphelper/refcountedmutex.hxx>
 
 #include <cppuhelper/weakref.hxx>
 #include <cppuhelper/compbase.hxx>
@@ -69,12 +69,6 @@ namespace pq_sdbc_driver
 #define POSTGRE_TRACE(x) ((void)0)
 #endif
 
-class RefCountedMutex : public salhelper::SimpleReferenceObject
-{
-public:
-    osl::Mutex mutex;
-};
-
 struct ConnectionSettings;
 
 
@@ -160,7 +154,7 @@ class Connection : public ConnectionBase
     css::uno::Reference< css::uno::XComponentContext > m_ctx;
     css::uno::Reference< css::container::XNameAccess > m_typeMap;
     ConnectionSettings m_settings;
-    ::rtl::Reference< RefCountedMutex > m_refMutex;
+    ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
     css::uno::Reference< css::sdbc::XDatabaseMetaData > m_meta;
     WeakHashMap m_myStatements;
 
@@ -171,7 +165,7 @@ private:
 
 public:
     Connection(
-        const rtl::Reference< RefCountedMutex > &refMutex,
+        const rtl::Reference< comphelper::RefCountedMutex > &refMutex,
         const css::uno::Reference< css::uno::XComponentContext > & ctx );
 
     virtual ~Connection( ) override;
diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
index eab6b50e0ace..554635ec0ed9 100644
--- a/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
+++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.cxx
@@ -118,10 +118,10 @@ namespace pq_sdbc_driver
 #define DEFERRABILITY_NONE                7
 
 DatabaseMetaData::DatabaseMetaData(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const css::uno::Reference< css::sdbc::XConnection >  & origin,
     ConnectionSettings *pSettings )
-  : m_refMutex( refMutex ),
+  : m_xMutex( refMutex ),
     m_pSettings( pSettings ),
     m_origin( origin ),
     m_getIntSetting_stmt ( m_origin->prepareStatement("SELECT setting FROM pg_catalog.pg_settings WHERE name=?") )
@@ -899,7 +899,7 @@ sal_Int32 DatabaseMetaData::getMaxCharLiteralLength(  )
 // Copied / adapted / simplified from JDBC driver
 sal_Int32 DatabaseMetaData::getIntSetting(const OUString& settingName)
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
 
     Reference< XParameters > params(m_getIntSetting_stmt, UNO_QUERY_THROW );
     params->setString(1, settingName );
@@ -1093,9 +1093,9 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getProcedures(
 
 // LEM TODO: implement
 // LEM TODO: at least fake the columns, even if no row.
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     return new SequenceResultSet(
-        m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > > (), m_pSettings->tc );
+        m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > > (), m_pSettings->tc );
 }
 
 css::uno::Reference< XResultSet > DatabaseMetaData::getProcedureColumns(
@@ -1105,11 +1105,11 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getProcedureColumns(
     const OUString& columnNamePattern )
 {
     (void) catalog; (void) schemaPattern; (void) procedureNamePattern; (void) columnNamePattern;
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
 // LEM TODO: implement
 // LEM TODO: at least fake the columns, even if no row.
     return new SequenceResultSet(
-        m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc );
+        m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc );
 }
 
 css::uno::Reference< XResultSet > DatabaseMetaData::getTables(
@@ -1121,7 +1121,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTables(
     (void) catalog; (void) types;
     Statics &statics = getStatics();
 
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
 
     if (isLog(m_pSettings, LogLevel::Info))
     {
@@ -1194,7 +1194,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTables(
         closeable->close();
 
     return new SequenceResultSet(
-        m_refMutex, *this, statics.tablesRowNames, vec, m_pSettings->tc );
+        m_xMutex, *this, statics.tablesRowNames, vec, m_pSettings->tc );
 }
 
 namespace
@@ -1252,7 +1252,7 @@ namespace
 
 css::uno::Reference< XResultSet > DatabaseMetaData::getSchemas(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
 
     if (isLog(m_pSettings, LogLevel::Info))
     {
@@ -1281,24 +1281,24 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getSchemas(  )
     if( closeable.is() )
         closeable->close();
     return new SequenceResultSet(
-        m_refMutex, *this, getStatics().schemaNames, vec, m_pSettings->tc );
+        m_xMutex, *this, getStatics().schemaNames, vec, m_pSettings->tc );
 }
 
 css::uno::Reference< XResultSet > DatabaseMetaData::getCatalogs(  )
 {
     // LEM TODO: return the current catalog like JDBC driver?
     //           at least fake the columns, even if no content
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     return new SequenceResultSet(
-        m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc );
+        m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc );
 }
 
 css::uno::Reference< XResultSet > DatabaseMetaData::getTableTypes(  )
 {
     // LEM TODO: this can be made dynamic, see JDBC driver
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     return new SequenceResultSet(
-        m_refMutex, *this, getStatics().tableTypeNames, getStatics().tableTypeData,
+        m_xMutex, *this, getStatics().tableTypeNames, getStatics().tableTypeData,
         m_pSettings->tc );
 }
 
@@ -1456,7 +1456,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getColumns(
     Statics &statics = getStatics();
 
     // continue !
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
 
     if (isLog(m_pSettings, LogLevel::Info))
     {
@@ -1628,7 +1628,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getColumns(
         closeable->close();
 
     return new SequenceResultSet(
-        m_refMutex, *this, statics.columnRowNames, vec, m_pSettings->tc );
+        m_xMutex, *this, statics.columnRowNames, vec, m_pSettings->tc );
 }
 
 css::uno::Reference< XResultSet > DatabaseMetaData::getColumnPrivileges(
@@ -1639,7 +1639,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getColumnPrivileges(
 {
     (void) catalog;
 
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
 
     if (isLog(m_pSettings, LogLevel::Info))
     {
@@ -1668,7 +1668,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTablePrivileges(
     const OUString& schemaPattern,
     const OUString& tableNamePattern )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
 
     if (isLog(m_pSettings, LogLevel::Info))
     {
@@ -1697,9 +1697,9 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getBestRowIdentifier(
     sal_Bool )
 {
     //LEM TODO: implement! See JDBC driver
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     return new SequenceResultSet(
-        m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc );
+        m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc );
 }
 
 css::uno::Reference< XResultSet > DatabaseMetaData::getVersionColumns(
@@ -1708,9 +1708,9 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getVersionColumns(
     const OUString& )
 {
     //LEM TODO: implement! See JDBC driver
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     return new SequenceResultSet(
-        m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc );
+        m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc );
 }
 
 css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys(
@@ -1719,7 +1719,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys(
     const OUString& table )
 {
     //LEM TODO: review
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
 
 //        1.  TABLE_CAT string => table catalog (may be NULL )
 //        2. TABLE_SCHEM string => table schema (may be NULL )
@@ -1837,7 +1837,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getPrimaryKeys(
         elements ++;
     }
     return new SequenceResultSet(
-        m_refMutex, *this, getStatics().primaryKeyNames, ret, m_pSettings->tc );
+        m_xMutex, *this, getStatics().primaryKeyNames, ret, m_pSettings->tc );
 }
 
 // Copied / adapted / simplified from JDBC driver
@@ -2317,7 +2317,7 @@ namespace
 css::uno::Reference< XResultSet > DatabaseMetaData::getTypeInfo(  )
 {
     // Note: Indexes start at 0 (in the API doc, they start at 1)
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
 
     if (isLog(m_pSettings, LogLevel::Info))
     {
@@ -2355,7 +2355,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getTypeInfo(  )
     std::sort( vec.begin(), vec.end(), TypeInfoByDataTypeSorter() );
 
     return new SequenceResultSet(
-        m_refMutex,
+        m_xMutex,
         *this,
         getStatics().typeinfoColumnNames,
         vec,
@@ -2372,7 +2372,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getIndexInfo(
     sal_Bool )
 {
     //LEM TODO: review
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
 
     /*
        1. TABLE_CAT string -> table catalog (may be NULL )
@@ -2484,7 +2484,7 @@ css::uno::Reference< XResultSet > DatabaseMetaData::getIndexInfo(
         }
     }
     return new SequenceResultSet(
-        m_refMutex, *this, getStatics().indexinfoColumnNames,
+        m_xMutex, *this, getStatics().indexinfoColumnNames,
         vec,
         m_pSettings->tc );
 }
@@ -2559,9 +2559,9 @@ sal_Bool DatabaseMetaData::supportsBatchUpdates(  )
 css::uno::Reference< XResultSet > DatabaseMetaData::getUDTs( const css::uno::Any&, const OUString&, const OUString&, const css::uno::Sequence< sal_Int32 >& )
 {
     //LEM TODO: implement! See JDBC driver
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     return new SequenceResultSet(
-        m_refMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc );
+        m_xMutex, *this, std::vector< OUString >(), std::vector< std::vector< Any > >(), m_pSettings->tc );
 }
 
 css::uno::Reference< css::sdbc::XConnection > DatabaseMetaData::getConnection()
diff --git a/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx b/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx
index 2bb4ce1a0ddf..c016886f2643 100644
--- a/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx
+++ b/connectivity/source/drivers/postgresql/pq_databasemetadata.hxx
@@ -48,7 +48,7 @@ namespace pq_sdbc_driver
 class DatabaseMetaData :
         public ::cppu::WeakImplHelper< css::sdbc::XDatabaseMetaData >
 {
-    ::rtl::Reference< RefCountedMutex > m_refMutex;
+    ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
     ConnectionSettings *m_pSettings;
     css::uno::Reference< css::sdbc::XConnection > m_origin;
     css::uno::Reference< css::sdbc::XPreparedStatement > m_getIntSetting_stmt;
@@ -75,7 +75,7 @@ class DatabaseMetaData :
 
 public:
     DatabaseMetaData(
-        const ::rtl::Reference< RefCountedMutex > & reMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & reMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings
         );
diff --git a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx
index 8a556c1a207f..4b46576d8667 100644
--- a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.cxx
@@ -55,7 +55,7 @@ namespace pq_sdbc_driver
 {
 
 FakedUpdateableResultSet::FakedUpdateableResultSet(
-        const ::rtl::Reference< RefCountedMutex > & mutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & mutex,
         const css::uno::Reference< css::uno::XInterface > &owner,
         ConnectionSettings **pSettings,
         PGresult *result,
diff --git a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx
index 74ed8c8415ee..65113344cdec 100644
--- a/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx
+++ b/connectivity/source/drivers/postgresql/pq_fakedupdateableresultset.hxx
@@ -56,7 +56,7 @@ class FakedUpdateableResultSet :
 
 public:
     FakedUpdateableResultSet(
-        const ::rtl::Reference< RefCountedMutex > & mutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & mutex,
         const css::uno::Reference< css::uno::XInterface > &owner,
         ConnectionSettings **pSettings,
         PGresult *result,
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
index dfa72d49ed3a..fba81ea56942 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.cxx
@@ -158,16 +158,16 @@ static bool isQuoted( const OString & str )
 }
 
 PreparedStatement::PreparedStatement(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const Reference< XConnection > & conn,
     struct ConnectionSettings *pSettings,
     const OString & stmt )
-    : PreparedStatement_BASE(refMutex->mutex)
+    : PreparedStatement_BASE(refMutex->GetMutex())
     , OPropertySetHelper(PreparedStatement_BASE::rBHelper)
     , m_connection(conn)
     , m_pSettings(pSettings)
     , m_stmt(stmt)
-    , m_refMutex(refMutex)
+    , m_xMutex(refMutex)
     , m_multipleResultAvailable(false)
     , m_multipleResultUpdateCount(0)
     , m_lastOidInserted( InvalidOid )
@@ -266,7 +266,7 @@ void PreparedStatement::close(  )
     Reference< XConnection > r;
     Reference< XCloseable > resultSet;
     {
-        MutexGuard guard( m_refMutex->mutex );
+        MutexGuard guard( m_xMutex->GetMutex() );
         m_pSettings = nullptr;
         r = m_connection;
         m_connection.clear();
@@ -318,7 +318,7 @@ sal_Int32 PreparedStatement::executeUpdate( )
 
 sal_Bool PreparedStatement::execute( )
 {
-    osl::MutexGuard guard( m_refMutex->mutex );
+    osl::MutexGuard guard( m_xMutex->GetMutex() );
 
     OStringBuffer buf( m_stmt.getLength() *2 );
 
@@ -379,7 +379,7 @@ sal_Bool PreparedStatement::execute( )
     m_lastTableInserted.clear();
 
     struct CommandData data;
-    data.refMutex = m_refMutex;
+    data.refMutex = m_xMutex;
     data.ppSettings = &m_pSettings;
     data.pLastOidInserted = &m_lastOidInserted;
     data.pLastQuery = &m_lastQuery;
@@ -398,7 +398,7 @@ Reference< XConnection > PreparedStatement::getConnection(  )
 {
     Reference< XConnection > ret;
     {
-        MutexGuard guard( m_refMutex->mutex );
+        MutexGuard guard( m_xMutex->GetMutex() );
         checkClosed();
         ret = m_connection;
     }
@@ -409,7 +409,7 @@ Reference< XConnection > PreparedStatement::getConnection(  )
 void PreparedStatement::setNull( sal_Int32 parameterIndex, sal_Int32 sqlType )
 {
     (void)sqlType;
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( parameterIndex );
     m_vars[parameterIndex-1] = OString( "NULL" );
@@ -419,7 +419,7 @@ void PreparedStatement::setObjectNull(
     sal_Int32 parameterIndex, sal_Int32 sqlType, const OUString& typeName )
 {
     (void) sqlType; (void) typeName;
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( parameterIndex );
     m_vars[parameterIndex-1] = OString( "NULL" );
@@ -428,7 +428,7 @@ void PreparedStatement::setObjectNull(
 
 void PreparedStatement::setBoolean( sal_Int32 parameterIndex, sal_Bool x )
 {
-    MutexGuard guard(m_refMutex->mutex );
+    MutexGuard guard(m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( parameterIndex );
     if( x )
@@ -450,7 +450,7 @@ void PreparedStatement::setShort( sal_Int32 parameterIndex, sal_Int16 x )
 void PreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x )
 {
 //     printf( "setString %d %d\n ",  parameterIndex, x);
-    MutexGuard guard(m_refMutex->mutex );
+    MutexGuard guard(m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( parameterIndex );
     OStringBuffer buf( 20 );
@@ -462,7 +462,7 @@ void PreparedStatement::setInt( sal_Int32 parameterIndex, sal_Int32 x )
 
 void PreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x )
 {
-    MutexGuard guard(m_refMutex->mutex );
+    MutexGuard guard(m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( parameterIndex );
     OStringBuffer buf( 20 );
@@ -474,7 +474,7 @@ void PreparedStatement::setLong( sal_Int32 parameterIndex, sal_Int64 x )
 
 void PreparedStatement::setFloat( sal_Int32 parameterIndex, float x )
 {
-    MutexGuard guard(m_refMutex->mutex );
+    MutexGuard guard(m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( parameterIndex );
     OStringBuffer buf( 20 );
@@ -486,7 +486,7 @@ void PreparedStatement::setFloat( sal_Int32 parameterIndex, float x )
 
 void PreparedStatement::setDouble( sal_Int32 parameterIndex, double x )
 {
-    MutexGuard guard(m_refMutex->mutex );
+    MutexGuard guard(m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( parameterIndex );
     OStringBuffer buf( 20 );
@@ -500,7 +500,7 @@ void PreparedStatement::setString( sal_Int32 parameterIndex, const OUString& x )
 {
 //     printf( "setString %d %s\n ", parameterIndex,
 //             OUStringToOString( x , RTL_TEXTENCODING_ASCII_US ).getStr());
-    MutexGuard guard(m_refMutex->mutex );
+    MutexGuard guard(m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( parameterIndex );
     OStringBuffer buf( 20 );
@@ -516,7 +516,7 @@ void PreparedStatement::setString( sal_Int32 parameterIndex, const OUString& x )
 void PreparedStatement::setBytes(
     sal_Int32 parameterIndex, const Sequence< sal_Int8 >& x )
 {
-    MutexGuard guard(m_refMutex->mutex );
+    MutexGuard guard(m_xMutex->GetMutex() );
     checkClosed();
     checkColumnIndex( parameterIndex );
     OStringBuffer buf( 20 );
@@ -664,7 +664,7 @@ void PreparedStatement::setArray(
 
 void PreparedStatement::clearParameters(  )
 {
-    MutexGuard guard(m_refMutex->mutex );
+    MutexGuard guard(m_xMutex->GetMutex() );
     m_vars = OStringVector ( m_vars.size() );
 }
 
@@ -775,7 +775,7 @@ sal_Bool PreparedStatement::getMoreResults(  )
 
 Reference< XResultSet > PreparedStatement::getGeneratedValues(  )
 {
-    osl::MutexGuard guard( m_refMutex->mutex );
+    osl::MutexGuard guard( m_xMutex->GetMutex() );
     return getGeneratedValuesFromLastInsert(
         m_pSettings, m_connection, m_lastOidInserted, m_lastTableInserted, m_lastQuery );
 }
diff --git a/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx b/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx
index 91e94bb85724..97491bafe964 100644
--- a/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx
+++ b/connectivity/source/drivers/postgresql/pq_preparedstatement.hxx
@@ -82,7 +82,7 @@ private:
     css::uno::Reference< css::sdbc::XCloseable > m_lastResultset;
     OString m_stmt;
     OString m_executedStatement;
-    ::rtl::Reference< RefCountedMutex > m_refMutex;
+    ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
     OStringVector m_vars;
     OStringVector m_splittedStatement;
     bool  m_multipleResultAvailable;
@@ -96,7 +96,7 @@ public:
      * @param ppConnection The piece of memory, pConnection points to, is accessible
      *                     as long as a reference to paramenter con is held.
      */
-    PreparedStatement( const rtl::Reference< RefCountedMutex > & refMutex,
+    PreparedStatement( const rtl::Reference< comphelper::RefCountedMutex > & refMutex,
                        const css::uno::Reference< css::sdbc::XConnection> & con,
                        struct ConnectionSettings *pSettings,
                        const OString &stmt );
diff --git a/connectivity/source/drivers/postgresql/pq_resultset.cxx b/connectivity/source/drivers/postgresql/pq_resultset.cxx
index 51b7989c613b..3839e72e3a73 100644
--- a/connectivity/source/drivers/postgresql/pq_resultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_resultset.cxx
@@ -76,7 +76,7 @@ void ResultSet::checkClosed()
 
 }
 
-ResultSet::ResultSet( const ::rtl::Reference< RefCountedMutex > & refMutex,
+ResultSet::ResultSet( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
                       const Reference< XInterface > & owner,
                       ConnectionSettings **ppSettings,
                       PGresult * result,
@@ -130,7 +130,7 @@ void ResultSet::close(  )
 {
     Reference< XInterface > owner;
     {
-        MutexGuard guard( m_refMutex->mutex );
+        MutexGuard guard( m_xMutex->GetMutex() );
         if( m_result )
         {
             PQclear(m_result );
@@ -144,15 +144,15 @@ void ResultSet::close(  )
 
 Reference< XResultSetMetaData > ResultSet::getMetaData(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     return new ResultSetMetaData(
-        m_refMutex, this, this, m_ppSettings, m_result, m_schema, m_table );
+        m_xMutex, this, this, m_ppSettings, m_result, m_schema, m_table );
 }
 
 sal_Int32 ResultSet::findColumn( const OUString& columnName )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     sal_Int32 res = PQfnumber( m_result,
                                OUStringToOString( columnName, ConnectionSettings::encoding ).getStr());
diff --git a/connectivity/source/drivers/postgresql/pq_resultset.hxx b/connectivity/source/drivers/postgresql/pq_resultset.hxx
index 40e4df23e547..4b2bb6f41fb9 100644
--- a/connectivity/source/drivers/postgresql/pq_resultset.hxx
+++ b/connectivity/source/drivers/postgresql/pq_resultset.hxx
@@ -69,7 +69,7 @@ protected:
 
 public:
     ResultSet(
-        const ::rtl::Reference< RefCountedMutex > & mutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & mutex,
         const css::uno::Reference< css::uno::XInterface > &owner,
         ConnectionSettings **pSettings,
         PGresult *result,
diff --git a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx
index 46f490278bf7..646444bf0542 100644
--- a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx
+++ b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.cxx
@@ -113,14 +113,14 @@ static void extractPrecisionAndScale( sal_Int32 atttypmod, sal_Int32 *precision,
 }
 
 ResultSetMetaData::ResultSetMetaData(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const css::uno::Reference< css::sdbc::XResultSet >  & origin,
     ResultSet * pResultSet,
     ConnectionSettings **ppSettings,
     PGresult *pResult,
     const OUString &schemaName,
     const OUString &tableName ) :
-    m_refMutex( refMutex ),
+    m_xMutex( refMutex ),
     m_ppSettings( ppSettings ),
     m_origin( origin ),
     m_tableName( tableName ),
@@ -225,7 +225,7 @@ sal_Int32 ResultSetMetaData::getIntColumnProperty( const OUString & name, int in
     sal_Int32 ret = def; // give defensive answers, when data is not available
     try
     {
-        MutexGuard guard( m_refMutex->mutex );
+        MutexGuard guard( m_xMutex->GetMutex() );
         checkColumnIndex( index );
         Reference< XPropertySet > set = getColumnByIndex( index );
 
@@ -245,7 +245,7 @@ bool ResultSetMetaData::getBoolColumnProperty( const OUString & name, int index,
     bool ret = def;
     try
     {
-        MutexGuard guard( m_refMutex->mutex );
+        MutexGuard guard( m_xMutex->GetMutex() );
         checkColumnIndex( index );
         Reference< XPropertySet > set = getColumnByIndex( index );
         if( set.is() )
@@ -324,7 +324,7 @@ sal_Bool ResultSetMetaData::isSigned( sal_Int32 column )
 
 sal_Int32 ResultSetMetaData::getColumnDisplaySize( sal_Int32 column )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkColumnIndex( column );
     return m_colDesc[column-1].displaySize;
 }
@@ -336,7 +336,7 @@ OUString ResultSetMetaData::getColumnLabel( sal_Int32 column )
 
 OUString ResultSetMetaData::getColumnName( sal_Int32 column )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkColumnIndex( column );
 
     return m_colDesc[column-1].name;
@@ -350,14 +350,14 @@ OUString ResultSetMetaData::getSchemaName( sal_Int32 column )
 
 sal_Int32 ResultSetMetaData::getPrecision( sal_Int32 column )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkColumnIndex( column );
     return m_colDesc[column-1].precision;
 }
 
 sal_Int32 ResultSetMetaData::getScale( sal_Int32 column )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkColumnIndex( column );
     return m_colDesc[column-1].scale;
 }
@@ -391,7 +391,7 @@ OUString ResultSetMetaData::getColumnTypeName( sal_Int32 column )
     OUString ret; // give defensive answers, when data is not available
     try
     {
-        MutexGuard guard( m_refMutex->mutex );
+        MutexGuard guard( m_xMutex->GetMutex() );
         checkColumnIndex( column );
         Reference< XPropertySet > set = getColumnByIndex( column );
 
diff --git a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx
index 70ba16e5d3b6..1beede2b835d 100644
--- a/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx
+++ b/connectivity/source/drivers/postgresql/pq_resultsetmetadata.hxx
@@ -64,7 +64,7 @@ class ResultSet;
 class ResultSetMetaData :
         public ::cppu::WeakImplHelper< css::sdbc::XResultSetMetaData >
 {
-    ::rtl::Reference< RefCountedMutex > m_refMutex;
+    ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
     ConnectionSettings **m_ppSettings;
     css::uno::Reference< css::sdbc::XResultSet > m_origin;
     css::uno::Reference< css::beans::XPropertySet > m_table;
@@ -90,7 +90,7 @@ class ResultSetMetaData :
 
 public:
     ResultSetMetaData(
-        const ::rtl::Reference< RefCountedMutex > & reMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & reMutex,
         const css::uno::Reference< css::sdbc::XResultSet >  & origin,
         ResultSet *pResultSet,
         ConnectionSettings **pSettings,
diff --git a/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx b/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx
index 5fb50e7e63a9..eefa362335c8 100644
--- a/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_sequenceresultset.cxx
@@ -61,7 +61,7 @@ Any SequenceResultSet::getValue( sal_Int32 columnIndex )
 }
 
 SequenceResultSet::SequenceResultSet(
-    const ::rtl::Reference< RefCountedMutex > & mutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & mutex,
     const css::uno::Reference< css::uno::XInterface > &owner,
     const std::vector< OUString > &colNames,
     const std::vector< std::vector< Any > > &data,
diff --git a/connectivity/source/drivers/postgresql/pq_sequenceresultset.hxx b/connectivity/source/drivers/postgresql/pq_sequenceresultset.hxx
index bf22e9de8d52..3b97e24a3001 100644
--- a/connectivity/source/drivers/postgresql/pq_sequenceresultset.hxx
+++ b/connectivity/source/drivers/postgresql/pq_sequenceresultset.hxx
@@ -70,7 +70,7 @@ protected:
 
 public:
     SequenceResultSet(
-        const ::rtl::Reference< RefCountedMutex > & mutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & mutex,
         const css::uno::Reference< css::uno::XInterface > &owner,
         const std::vector< OUString > &colNames,
         const std::vector< std::vector< css::uno::Any > > &data,
diff --git a/connectivity/source/drivers/postgresql/pq_statement.cxx b/connectivity/source/drivers/postgresql/pq_statement.cxx
index 39063d8e6548..6abd625c1a5c 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.cxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.cxx
@@ -152,14 +152,14 @@ static ::cppu::IPropertyArrayHelper & getStatementPropertyArrayHelper()
     return *pArrayHelper;
 }
 
-Statement::Statement( const ::rtl::Reference< RefCountedMutex > & refMutex,
+Statement::Statement( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
                       const Reference< XConnection > & conn,
                       struct ConnectionSettings *pSettings )
-    : Statement_BASE( refMutex->mutex )
+    : Statement_BASE( refMutex->GetMutex() )
     , OPropertySetHelper( Statement_BASE::rBHelper )
     , m_connection( conn )
     , m_pSettings( pSettings )
-    , m_refMutex( refMutex )
+    , m_xMutex( refMutex )
     , m_multipleResultAvailable(false)
     , m_multipleResultUpdateCount(0)
     , m_lastOidInserted(InvalidOid)
@@ -221,7 +221,7 @@ void Statement::close(  )
     Reference< XConnection > r;
     Reference< XCloseable > resultSet;
     {
-        MutexGuard guard( m_refMutex->mutex );
+        MutexGuard guard( m_xMutex->GetMutex() );
         m_pSettings = nullptr;
         r = m_connection;
         m_connection.clear();
@@ -820,7 +820,7 @@ Reference< XResultSet > getGeneratedValuesFromLastInsert(
 
 sal_Bool Statement::execute( const OUString& sql )
 {
-    osl::MutexGuard guard( m_refMutex->mutex );
+    osl::MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     OString cmd = OUStringToOString( sql, m_pSettings );
 
@@ -828,7 +828,7 @@ sal_Bool Statement::execute( const OUString& sql )
     m_lastTableInserted.clear();
 
     struct CommandData data;
-    data.refMutex = m_refMutex;
+    data.refMutex = m_xMutex;
     data.ppSettings = &m_pSettings;
     data.pLastOidInserted = &m_lastOidInserted;
     data.pLastQuery = &m_lastQuery;
@@ -847,7 +847,7 @@ Reference< XConnection > Statement::getConnection(  )
 {
     Reference< XConnection > ret;
     {
-        MutexGuard guard( m_refMutex->mutex );
+        MutexGuard guard( m_xMutex->GetMutex() );
         checkClosed();
         ret = m_connection;
     }
@@ -966,7 +966,7 @@ void Statement::disposing()
 
 Reference< XResultSet > Statement::getGeneratedValues(  )
 {
-    osl::MutexGuard guard( m_refMutex->mutex );
+    osl::MutexGuard guard( m_xMutex->GetMutex() );
     return getGeneratedValuesFromLastInsert(
         m_pSettings, m_connection, m_lastOidInserted, m_lastTableInserted, m_lastQuery );
 }
diff --git a/connectivity/source/drivers/postgresql/pq_statement.hxx b/connectivity/source/drivers/postgresql/pq_statement.hxx
index 0ac5e40a711e..8b91ec596642 100644
--- a/connectivity/source/drivers/postgresql/pq_statement.hxx
+++ b/connectivity/source/drivers/postgresql/pq_statement.hxx
@@ -78,7 +78,7 @@ private:
     css::uno::Reference< css::sdbc::XConnection > m_connection;
     ConnectionSettings *m_pSettings;
     css::uno::Reference< css::sdbc::XCloseable > m_lastResultset;
-    ::rtl::Reference< RefCountedMutex > m_refMutex;
+    ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
     bool  m_multipleResultAvailable;
     sal_Int32 m_multipleResultUpdateCount;
     sal_Int32 m_lastOidInserted;
@@ -90,7 +90,7 @@ public:
      * @param ppConnection The piece of memory, pConnection points to, is accessible
      *                     as long as a reference to paramenter con is held.
      */
-    Statement( const rtl::Reference< RefCountedMutex > & refMutex,
+    Statement( const rtl::Reference< comphelper::RefCountedMutex > & refMutex,
                const css::uno::Reference< css::sdbc::XConnection> & con,
                struct ConnectionSettings *pSettings );
 
@@ -174,7 +174,7 @@ struct CommandData
     OUString *pLastTableInserted;
     css::uno::Reference< css::sdbc::XCloseable > *pLastResultset;
     OString *pLastQuery;
-    ::rtl::Reference< RefCountedMutex > refMutex;
+    ::rtl::Reference< comphelper::RefCountedMutex > refMutex;
     css::uno::Reference< css::uno::XInterface > owner;
     css::uno::Reference< css::sdbcx::XTablesSupplier > tableSupplier;
     sal_Int32 concurrency;
diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
index 12c525f68f01..773053b9fe98 100644
--- a/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
+++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.cxx
@@ -84,7 +84,7 @@ namespace pq_sdbc_driver
 
 
 css::uno::Reference< css::sdbc::XCloseable > UpdateableResultSet::createFromPGResultSet(
-    const ::rtl::Reference< RefCountedMutex > & mutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & mutex,
     const css::uno::Reference< css::uno::XInterface > &owner,
     ConnectionSettings **ppSettings,
     PGresult *result,
@@ -193,7 +193,7 @@ OUString UpdateableResultSet::buildWhereClause()
 
 void UpdateableResultSet::insertRow(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     if (isLog(*m_ppSettings, LogLevel::Info))
     {
         log(*m_ppSettings, LogLevel::Info, "UpdateableResultSet::insertRow got called");
@@ -287,7 +287,7 @@ void UpdateableResultSet::insertRow(  )
 
 void UpdateableResultSet::updateRow(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     if (isLog(*m_ppSettings, LogLevel::Info))
     {
         log(*m_ppSettings, LogLevel::Info, "UpdateableResultSet::updateRow got called");
@@ -375,7 +375,7 @@ void UpdateableResultSet::deleteRow(  )
 
 void UpdateableResultSet::cancelRowUpdates(  )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     m_updateableField = UpdateableFieldVector();
 }
 
@@ -399,7 +399,7 @@ void UpdateableResultSet::checkUpdate( sal_Int32 columnIndex)
 
 void UpdateableResultSet::updateNull( sal_Int32 columnIndex )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkUpdate( columnIndex );
     m_updateableField[columnIndex-1].value = Any();
@@ -407,7 +407,7 @@ void UpdateableResultSet::updateNull( sal_Int32 columnIndex )
 
 void UpdateableResultSet::updateBoolean( sal_Int32 columnIndex, sal_Bool x )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkUpdate( columnIndex );
 
@@ -429,7 +429,7 @@ void UpdateableResultSet::updateShort( sal_Int32 columnIndex, sal_Int16 x )
 void UpdateableResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x )
 {
     updateLong( columnIndex, x );
-//     MutexGuard guard( m_refMutex->mutex );
+//     MutexGuard guard( m_xMutex->GetMutex() );
 //     checkClosed();
 //     checkUpdate( columnIndex );
 
@@ -439,7 +439,7 @@ void UpdateableResultSet::updateInt( sal_Int32 columnIndex, sal_Int32 x )
 
 void UpdateableResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkUpdate( columnIndex );
 
@@ -453,7 +453,7 @@ void UpdateableResultSet::updateLong( sal_Int32 columnIndex, sal_Int64 x )
 void UpdateableResultSet::updateFloat( sal_Int32 columnIndex, float x )
 {
 
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkUpdate( columnIndex );
 
@@ -462,7 +462,7 @@ void UpdateableResultSet::updateFloat( sal_Int32 columnIndex, float x )
 
 void UpdateableResultSet::updateDouble( sal_Int32 columnIndex, double x )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkUpdate( columnIndex );
 
@@ -471,7 +471,7 @@ void UpdateableResultSet::updateDouble( sal_Int32 columnIndex, double x )
 
 void UpdateableResultSet::updateString( sal_Int32 columnIndex, const OUString& x )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkUpdate( columnIndex );
 
@@ -480,7 +480,7 @@ void UpdateableResultSet::updateString( sal_Int32 columnIndex, const OUString& x
 
 void UpdateableResultSet::updateBytes( sal_Int32 columnIndex, const css::uno::Sequence< sal_Int8 >& x )
 {
-    MutexGuard guard( m_refMutex->mutex );
+    MutexGuard guard( m_xMutex->GetMutex() );
     checkClosed();
     checkUpdate( columnIndex );
 
diff --git a/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx b/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx
index 9c21521d81cd..9da077ea6db7 100644
--- a/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx
+++ b/connectivity/source/drivers/postgresql/pq_updateableresultset.hxx
@@ -74,7 +74,7 @@ class UpdateableResultSet :
 
 protected:
     UpdateableResultSet(
-        const ::rtl::Reference< RefCountedMutex > & mutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & mutex,
         const css::uno::Reference< css::uno::XInterface > &owner,
         const std::vector< OUString > &colNames,
         const std::vector< std::vector< css::uno::Any > > &data,
@@ -113,7 +113,7 @@ protected:
 
 public:
     static css::uno::Reference< css::sdbc::XCloseable > createFromPGResultSet(
-        const ::rtl::Reference< RefCountedMutex > & mutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & mutex,
         const css::uno::Reference< css::uno::XInterface > &owner,
         ConnectionSettings **ppSettings,
         PGresult *result,
diff --git a/connectivity/source/drivers/postgresql/pq_xbase.cxx b/connectivity/source/drivers/postgresql/pq_xbase.cxx
index 8da5422c5cea..e27719b52c59 100644
--- a/connectivity/source/drivers/postgresql/pq_xbase.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xbase.cxx
@@ -60,15 +60,15 @@ namespace pq_sdbc_driver
 ReflectionBase::ReflectionBase(
     const OUString &implName,
     const css::uno::Sequence< OUString > &supportedServices,
-    const ::rtl::Reference< RefCountedMutex >& refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex >& refMutex,
     const css::uno::Reference< css::sdbc::XConnection > &conn,
     ConnectionSettings *pSettings,
     cppu::IPropertyArrayHelper & props /* must survive this object !*/ )
-    : ReflectionBase_BASE( refMutex->mutex ),
+    : ReflectionBase_BASE( refMutex->GetMutex() ),
       OPropertySetHelper( ReflectionBase_BASE::rBHelper ),
       m_implName( implName ),
       m_supportedServices( supportedServices ),
-      m_refMutex( refMutex ),
+      m_xMutex( refMutex ),
       m_conn( conn ),
       m_pSettings( pSettings ),
       m_propsDesc( props ),
@@ -152,7 +152,7 @@ Sequence< OUString > ReflectionBase::getSupportedServiceNames()
 
 Sequence< css::uno::Type > ReflectionBase::getTypes()
 {
-    osl::MutexGuard guard( m_refMutex->mutex );
+    osl::MutexGuard guard( m_xMutex->GetMutex() );
     static Sequence< css::uno::Type > collection(
             ::comphelper::concatSequences(
                 ::cppu::OPropertySetHelper::getTypes(),
diff --git a/connectivity/source/drivers/postgresql/pq_xbase.hxx b/connectivity/source/drivers/postgresql/pq_xbase.hxx
index bf5359fe5fc4..6e7ac8413f47 100644
--- a/connectivity/source/drivers/postgresql/pq_xbase.hxx
+++ b/connectivity/source/drivers/postgresql/pq_xbase.hxx
@@ -60,7 +60,7 @@ class ReflectionBase :
 protected:
     const OUString m_implName;
     const css::uno::Sequence< OUString > m_supportedServices;
-    ::rtl::Reference< RefCountedMutex > m_refMutex;
+    ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
     css::uno::Reference< css::sdbc::XConnection > m_conn;
     ConnectionSettings *m_pSettings;
     cppu::IPropertyArrayHelper & m_propsDesc;
@@ -69,7 +69,7 @@ public:
     ReflectionBase(
         const OUString &implName,
         const css::uno::Sequence< OUString > &supportedServices,
-        const ::rtl::Reference< RefCountedMutex >& refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex >& refMutex,
         const css::uno::Reference< css::sdbc::XConnection > &conn,
         ConnectionSettings *pSettings,
         cppu::IPropertyArrayHelper & props /* must survive this object !*/ );
diff --git a/connectivity/source/drivers/postgresql/pq_xcolumn.cxx b/connectivity/source/drivers/postgresql/pq_xcolumn.cxx
index 5caf2d0f88af..bda0a88a0407 100644
--- a/connectivity/source/drivers/postgresql/pq_xcolumn.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xcolumn.cxx
@@ -45,7 +45,7 @@ using com::sun::star::beans::XPropertySet;
 
 namespace pq_sdbc_driver
 {
-Column::Column( const ::rtl::Reference< RefCountedMutex > & refMutex,
+Column::Column( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
                 const Reference< css::sdbc::XConnection > & connection,
                 ConnectionSettings *pSettings)
     : ReflectionBase(
@@ -60,13 +60,13 @@ Column::Column( const ::rtl::Reference< RefCountedMutex > & refMutex,
 Reference< XPropertySet > Column::createDataDescriptor(  )
 {
     ColumnDescriptor * pColumn = new ColumnDescriptor(
-        m_refMutex, m_conn, m_pSettings );
+        m_xMutex, m_conn, m_pSettings );
     pColumn->copyValuesFrom( this );
     return Reference< XPropertySet > ( pColumn );
 }
 
 ColumnDescriptor::ColumnDescriptor(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const Reference< css::sdbc::XConnection > & connection,
     ConnectionSettings *pSettings)
     : ReflectionBase(
@@ -81,7 +81,7 @@ ColumnDescriptor::ColumnDescriptor(
 Reference< XPropertySet > ColumnDescriptor::createDataDescriptor(  )
 {
     ColumnDescriptor * pColumn = new ColumnDescriptor(
-        m_refMutex, m_conn, m_pSettings );
+        m_xMutex, m_conn, m_pSettings );
     pColumn->copyValuesFrom( this );
 
     return Reference< XPropertySet > ( pColumn );
diff --git a/connectivity/source/drivers/postgresql/pq_xcolumn.hxx b/connectivity/source/drivers/postgresql/pq_xcolumn.hxx
index 1a8d9ff30502..ea4e099fcd2b 100644
--- a/connectivity/source/drivers/postgresql/pq_xcolumn.hxx
+++ b/connectivity/source/drivers/postgresql/pq_xcolumn.hxx
@@ -52,7 +52,7 @@ namespace pq_sdbc_driver
 class Column : public ReflectionBase
 {
 public:
-    Column( const ::rtl::Reference< RefCountedMutex > & refMutex,
+    Column( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
             const css::uno::Reference< css::sdbc::XConnection > & connection,
             ConnectionSettings *pSettings);
 
@@ -66,7 +66,7 @@ class ColumnDescriptor : public ReflectionBase
 {
 public:
     ColumnDescriptor(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection > & connection,
         ConnectionSettings *pSettings );
 
diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
index a1c0562b31de..e8e16991c910 100644
--- a/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xcolumns.cxx
@@ -104,7 +104,7 @@ static Any isAutoIncrement( const OUString & defaultValue )
 }
 
 Columns::Columns(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings,
         const OUString &schemaName,
@@ -226,7 +226,7 @@ OUString columnMetaData2SDBCX(
 
 // class CommentChanger : public cppu::WeakImplHelper< XPropertyChangeListener >
 // {
-//     ::rtl::Reference< RefCountedMutex > m_refMutex;
+//     ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
 //     css::uno::Reference< css::sdbc::XConnection > m_connection;
 //     ConnectionSettings *m_pSettings;
 //     OUString m_schema;
@@ -235,13 +235,13 @@ OUString columnMetaData2SDBCX(
 
 // public:
 //     CommentChanger(
-//         const ::rtl::Reference< RefCountedMutex > & refMutex,
+//         const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
 //         const css::uno::Reference< css::sdbc::XConnection > & connection,
 //         ConnectionSettings *pSettings,
 //         const OUString & schema,
 //         const OUString & table,
 //         const OUString & column ) :
-//         m_refMutex( refMutex ),
+//         m_xMutex( refMutex ),
 //         m_connection( connection ),
 //         m_pSettings( pSettings ),
 //         m_schema ( schema ),
@@ -253,13 +253,13 @@ OUString columnMetaData2SDBCX(
 //     // Methods
 //     virtual void SAL_CALL disposing( const css::lang::EventObject& Source ) throw (css::uno::RuntimeException)
 //     {
-//         osl::MutexGuard guard( m_refMutex->mutex );
+//         osl::MutexGuard guard( m_xMutex->GetMutex() );
 //         m_connection.clear();
 //     }
 //         // Methods
 //     virtual void SAL_CALL propertyChange( const css::beans::PropertyChangeEvent& evt ) throw (css::uno::RuntimeException)
 //     {
-//         osl::MutexGuard guard( m_refMutex->mutex );
+//         osl::MutexGuard guard( m_xMutex->GetMutex() );
 //         OUStringBuffer buf( 128 );
 //         OUString comment;
 //         evt.NewValue >>= comment;
@@ -289,7 +289,7 @@ void Columns::refresh()
             buf.append( OUStringToOString( m_tableName, ConnectionSettings::encoding ) );
             log( m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr() );
         }
-        osl::MutexGuard guard( m_refMutex->mutex );
+        osl::MutexGuard guard( m_xMutex->GetMutex() );
 
         Statics &st = getStatics();
         Reference< XDatabaseMetaData > meta = m_origin->getMetaData();
@@ -307,14 +307,14 @@ void Columns::refresh()
         while( rs->next() )
         {
             Column * pColumn =
-                new Column( m_refMutex, m_origin, m_pSettings );
+                new Column( m_xMutex, m_origin, m_pSettings );
             Reference< css::beans::XPropertySet > prop = pColumn;
 
             OUString name = columnMetaData2SDBCX( pColumn, xRow );
 //             pColumn->addPropertyChangeListener(
 //                 st.HELP_TEXT,
 //                 new CommentChanger(
-//                     m_refMutex,
+//                     m_xMutex,
 //                     m_origin,
 //                     m_pSettings,
 //                     m_schemaName,
@@ -462,7 +462,7 @@ void alterColumnByDescriptor(
 void Columns::appendByDescriptor(
     const css::uno::Reference< css::beans::XPropertySet >& future )
 {
-    osl::MutexGuard guard( m_refMutex->mutex );
+    osl::MutexGuard guard( m_xMutex->GetMutex() );
     Statics & st = getStatics();
     Reference< XPropertySet > past = createDataDescriptor();
     past->setPropertyValue( st.IS_NULLABLE, makeAny( css::sdbc::ColumnValue::NULLABLE ) );
@@ -496,7 +496,7 @@ void Columns::appendByDescriptor(
 
 void Columns::dropByIndex( sal_Int32 index )
 {
-    osl::MutexGuard guard( m_refMutex->mutex );
+    osl::MutexGuard guard( m_xMutex->GetMutex() );
     if( index < 0 ||  index >= (sal_Int32)m_values.size() )
     {
         throw css::lang::IndexOutOfBoundsException(
@@ -527,11 +527,11 @@ void Columns::dropByIndex( sal_Int32 index )
 
 css::uno::Reference< css::beans::XPropertySet > Columns::createDataDescriptor()
 {
-    return new ColumnDescriptor( m_refMutex, m_origin, m_pSettings );
+    return new ColumnDescriptor( m_xMutex, m_origin, m_pSettings );
 }
 
 Reference< css::container::XNameAccess > Columns::create(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const css::uno::Reference< css::sdbc::XConnection >  & origin,
     ConnectionSettings *pSettings,
     const OUString &schemaName,
@@ -548,7 +548,7 @@ Reference< css::container::XNameAccess > Columns::create(
 
 
 ColumnDescriptors::ColumnDescriptors(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings )
     : Container( refMutex, origin, pSettings,  "COLUMN-DESCRIPTOR" )
@@ -557,7 +557,7 @@ ColumnDescriptors::ColumnDescriptors(
 
 Reference< css::beans::XPropertySet > ColumnDescriptors::createDataDescriptor()
 {
-    return new ColumnDescriptor( m_refMutex, m_origin, m_pSettings );
+    return new ColumnDescriptor( m_xMutex, m_origin, m_pSettings );
 }
 
 }
diff --git a/connectivity/source/drivers/postgresql/pq_xcolumns.hxx b/connectivity/source/drivers/postgresql/pq_xcolumns.hxx
index d8ca464653ce..86bc585be296 100644
--- a/connectivity/source/drivers/postgresql/pq_xcolumns.hxx
+++ b/connectivity/source/drivers/postgresql/pq_xcolumns.hxx
@@ -63,7 +63,7 @@ class Columns : public Container
 
 public: // instances Columns 'exception safe'
     static css::uno::Reference< css::container::XNameAccess > create(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings,
         const OUString &schemaName,
@@ -72,7 +72,7 @@ public: // instances Columns 'exception safe'
 
 protected:
     Columns(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings,
         const OUString &schemaName,
@@ -104,7 +104,7 @@ class ColumnDescriptors : public Container
 {
 public:
     ColumnDescriptors(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings );
 
diff --git a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx
index 7894ba65d7d2..56a1fc67c62b 100644
--- a/connectivity/source/drivers/postgresql/pq_xcontainer.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xcontainer.cxx
@@ -134,12 +134,12 @@ public:
 };
 
 Container::Container(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const css::uno::Reference< css::sdbc::XConnection >  & origin,
     ConnectionSettings *pSettings,
     const OUString &type)
-    : ContainerBase( refMutex->mutex ),
-      m_refMutex( refMutex ),
+    : ContainerBase( refMutex->GetMutex() ),
+      m_xMutex( refMutex ),
       m_pSettings( pSettings ),
       m_origin( origin ),
       m_type( type )
@@ -266,7 +266,7 @@ void Container::rename( const OUString &oldName, const OUString &newName )
 {
     Any newValue;
     {
-        osl::MutexGuard guard ( m_refMutex->mutex );
+        osl::MutexGuard guard ( m_xMutex->GetMutex() );
         String2IntMap::iterator ii = m_name2index.find( oldName );
         if( ii != m_name2index.end() )
         {
@@ -282,7 +282,7 @@ void Container::rename( const OUString &oldName, const OUString &newName )
 
 void Container::dropByName( const OUString& elementName )
 {
-    osl::MutexGuard guard( m_refMutex->mutex );
+    osl::MutexGuard guard( m_xMutex->GetMutex() );
     String2IntMap::const_iterator ii = m_name2index.find( elementName );
     if( ii == m_name2index.end() )
     {
@@ -296,7 +296,7 @@ void Container::dropByName( const OUString& elementName )
 
 void Container::dropByIndex( sal_Int32 index )
 {
-    osl::MutexGuard guard( m_refMutex->mutex );
+    osl::MutexGuard guard( m_xMutex->GetMutex() );
     if( index < 0 ||  index >=(sal_Int32)m_values.size() )
     {
         throw css::lang::IndexOutOfBoundsException(
@@ -346,7 +346,7 @@ void Container::append(
     const css::uno::Reference< css::beans::XPropertySet >& descriptor )
 
 {
-    osl::MutexGuard guard( m_refMutex->mutex );
+    osl::MutexGuard guard( m_xMutex->GetMutex() );
 
     if( hasByName( name ) )
     {
diff --git a/connectivity/source/drivers/postgresql/pq_xcontainer.hxx b/connectivity/source/drivers/postgresql/pq_xcontainer.hxx
index fd595c639e08..0e788d1abb05 100644
--- a/connectivity/source/drivers/postgresql/pq_xcontainer.hxx
+++ b/connectivity/source/drivers/postgresql/pq_xcontainer.hxx
@@ -107,7 +107,7 @@ typedef ::cppu::WeakComponentImplHelper
 class /* abstract */ Container : public ContainerBase
 {
 protected:
-    ::rtl::Reference< RefCountedMutex > m_refMutex;
+    ::rtl::Reference< comphelper::RefCountedMutex > m_xMutex;
     ConnectionSettings *m_pSettings;
     css::uno::Reference< css::sdbc::XConnection > m_origin;
     String2IntMap m_name2index;  // maps the element name to an index
@@ -116,7 +116,7 @@ protected:
 
 public:
     Container(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings,
         const OUString & type  // for exception messages
diff --git a/connectivity/source/drivers/postgresql/pq_xindex.cxx b/connectivity/source/drivers/postgresql/pq_xindex.cxx
index 60169554e9d6..8a88ed64ca86 100644
--- a/connectivity/source/drivers/postgresql/pq_xindex.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xindex.cxx
@@ -62,7 +62,7 @@ using com::sun::star::beans::XPropertySet;
 
 namespace pq_sdbc_driver
 {
-Index::Index( const ::rtl::Reference< RefCountedMutex > & refMutex,
+Index::Index( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
           const Reference< css::sdbc::XConnection > & connection,
           ConnectionSettings *pSettings,
           const OUString & schemaName,
@@ -81,7 +81,7 @@ Index::Index( const ::rtl::Reference< RefCountedMutex > & refMutex,
 Reference< XPropertySet > Index::createDataDescriptor(  )
 {
     IndexDescriptor * pIndex = new IndexDescriptor(
-        m_refMutex, m_conn, m_pSettings );
+        m_xMutex, m_conn, m_pSettings );
     pIndex->copyValuesFrom( this );
 
     return Reference< XPropertySet > ( pIndex );
@@ -95,7 +95,7 @@ Reference< XNameAccess > Index::getColumns(  )
         getPropertyValue( getStatics().PRIVATE_COLUMN_INDEXES ) >>= columnNames;
         OUString indexName = extractStringProperty( this, getStatics().NAME );
         m_indexColumns = IndexColumns::create(
-             m_refMutex, m_conn, m_pSettings, m_schemaName,
+             m_xMutex, m_conn, m_pSettings, m_schemaName,
              m_tableName, indexName, columnNames );
     }
     return m_indexColumns;
@@ -137,7 +137,7 @@ Any Index::queryInterface( const Type & reqType )
 
 
 IndexDescriptor::IndexDescriptor(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const Reference< css::sdbc::XConnection > & connection,
     ConnectionSettings *pSettings )
     : ReflectionBase(
@@ -152,7 +152,7 @@ IndexDescriptor::IndexDescriptor(
 Reference< XPropertySet > IndexDescriptor::createDataDescriptor(  )
 {
     IndexDescriptor * pIndex = new IndexDescriptor(
-        m_refMutex, m_conn, m_pSettings );
+        m_xMutex, m_conn, m_pSettings );
     pIndex->copyValuesFrom( this );
     return Reference< XPropertySet > ( pIndex );
 }
@@ -162,12 +162,12 @@ Reference< XNameAccess > IndexDescriptor::getColumns(  )
     if( ! m_indexColumns.is() )
     {
         m_indexColumns = IndexColumnDescriptors::create(
-            m_refMutex, m_conn, m_pSettings );
+            m_xMutex, m_conn, m_pSettings );
 //         Sequence< OUString > columnNames;
 //         getPropertyValue( getStatics().PRIVATE_COLUMN_INDEXES ) >>= columnNames;
 //         OUString indexName = extractStringProperty( this, getStatics().NAME );
 //         m_indexColumns = IndexColumns::create(
-//              m_refMutex, m_conn, m_pSettings, m_schemaName,
+//              m_xMutex, m_conn, m_pSettings, m_schemaName,
 //              m_tableName, indexName, columnNames );
     }
     return m_indexColumns;
diff --git a/connectivity/source/drivers/postgresql/pq_xindex.hxx b/connectivity/source/drivers/postgresql/pq_xindex.hxx
index 7f22f1215575..26e5613630a2 100644
--- a/connectivity/source/drivers/postgresql/pq_xindex.hxx
+++ b/connectivity/source/drivers/postgresql/pq_xindex.hxx
@@ -59,7 +59,7 @@ class Index : public ReflectionBase,
     OUString m_tableName;
 
 public:
-    Index( const ::rtl::Reference< RefCountedMutex > & refMutex,
+    Index( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
            const css::uno::Reference< css::sdbc::XConnection > & connection,
            ConnectionSettings *pSettings,
            const OUString &schemaName,
@@ -93,7 +93,7 @@ class IndexDescriptor : public ReflectionBase,
 
 public:
     IndexDescriptor(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection > & connection,
         ConnectionSettings *pSettings);
 
diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumn.cxx b/connectivity/source/drivers/postgresql/pq_xindexcolumn.cxx
index ef2ceffebaa7..824a89ce33be 100644
--- a/connectivity/source/drivers/postgresql/pq_xindexcolumn.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xindexcolumn.cxx
@@ -45,7 +45,7 @@ using com::sun::star::beans::XPropertySet;
 
 namespace pq_sdbc_driver
 {
-IndexColumn::IndexColumn( const ::rtl::Reference< RefCountedMutex > & refMutex,
+IndexColumn::IndexColumn( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
                       const Reference< css::sdbc::XConnection > & connection,
                       ConnectionSettings *pSettings )
     : ReflectionBase(
@@ -60,7 +60,7 @@ IndexColumn::IndexColumn( const ::rtl::Reference< RefCountedMutex > & refMutex,
 Reference< XPropertySet > IndexColumn::createDataDescriptor(  )
 {
     IndexColumnDescriptor * pIndexColumn = new IndexColumnDescriptor(
-        m_refMutex, m_conn, m_pSettings  );
+        m_xMutex, m_conn, m_pSettings  );
     pIndexColumn->copyValuesFrom( this );
 
     return Reference< XPropertySet > ( pIndexColumn );
@@ -68,7 +68,7 @@ Reference< XPropertySet > IndexColumn::createDataDescriptor(  )
 
 
 IndexColumnDescriptor::IndexColumnDescriptor(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const Reference< css::sdbc::XConnection > & connection,
     ConnectionSettings *pSettings )
     : ReflectionBase(
@@ -83,7 +83,7 @@ IndexColumnDescriptor::IndexColumnDescriptor(
 Reference< XPropertySet > IndexColumnDescriptor::createDataDescriptor(  )
 {
     IndexColumnDescriptor * pIndexColumn = new IndexColumnDescriptor(
-        m_refMutex, m_conn, m_pSettings  );
+        m_xMutex, m_conn, m_pSettings  );
     pIndexColumn->copyValuesFrom( this );
 
     return Reference< XPropertySet > ( pIndexColumn );
diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumn.hxx b/connectivity/source/drivers/postgresql/pq_xindexcolumn.hxx
index 9dada6d18b10..5e7ae8d4fa65 100644
--- a/connectivity/source/drivers/postgresql/pq_xindexcolumn.hxx
+++ b/connectivity/source/drivers/postgresql/pq_xindexcolumn.hxx
@@ -53,7 +53,7 @@ class IndexColumn : public ReflectionBase
 {
 public:
     IndexColumn(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection > & connection,
         ConnectionSettings *pSettings);
 
@@ -67,7 +67,7 @@ class IndexColumnDescriptor : public ReflectionBase
 {
 public:
     IndexColumnDescriptor(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection > & connection,
         ConnectionSettings *pSettings);
 
diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx b/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx
index 638bf731d346..1bc732dbdcc3 100644
--- a/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xindexcolumns.cxx
@@ -72,7 +72,7 @@ namespace pq_sdbc_driver
 {
 
 IndexColumns::IndexColumns(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings,
         const OUString &schemaName,
@@ -112,7 +112,7 @@ void IndexColumns::refresh()
             log( m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr() );
         }
 
-        osl::MutexGuard guard( m_refMutex->mutex );
+        osl::MutexGuard guard( m_xMutex->GetMutex() );
 
         Statics &st = getStatics();
         Reference< XDatabaseMetaData > meta = m_origin->getMetaData();
@@ -134,7 +134,7 @@ void IndexColumns::refresh()
                 continue;
 
             IndexColumn * pIndexColumn =
-                new IndexColumn( m_refMutex, m_origin, m_pSettings );
+                new IndexColumn( m_xMutex, m_origin, m_pSettings );
             Reference< css::beans::XPropertySet > prop = pIndexColumn;
 
             columnMetaData2SDBCX( pIndexColumn, xRow );
@@ -160,7 +160,7 @@ void IndexColumns::appendByDescriptor(
     throw css::sdbc::SQLException(
         "SDBC-POSTGRESQL: IndexesColumns.appendByDescriptor not yet implemented",
         *this, OUString(), 1, Any() );
-//     osl::MutexGuard guard( m_refMutex->mutex );
+//     osl::MutexGuard guard( m_xMutex->GetMutex() );
 //     Statics & st = getStatics();
 //     Reference< XPropertySet > past = createDataDescriptor();
 //     past->setPropertyValue( st.IS_NULLABLE, makeAny( css::sdbc::ColumnValue::NULLABLE ) );
@@ -198,7 +198,7 @@ void IndexColumns::dropByIndex( sal_Int32 index )
     throw css::sdbc::SQLException(
         "SDBC-POSTGRESQL: IndexesColumns.dropByIndex not yet implemented",
         *this, OUString(), 1, Any() );
-//     osl::MutexGuard guard( m_refMutex->mutex );
+//     osl::MutexGuard guard( m_xMutex->GetMutex() );
 //     if( index < 0 ||  index >= m_values.getLength() )
 //     {
 //         OUStringBuffer buf( 128 );
@@ -231,11 +231,11 @@ void IndexColumns::dropByIndex( sal_Int32 index )
 
 Reference< css::beans::XPropertySet > IndexColumns::createDataDescriptor()
 {
-    return new IndexColumnDescriptor( m_refMutex, m_origin, m_pSettings );
+    return new IndexColumnDescriptor( m_xMutex, m_origin, m_pSettings );
 }
 
 Reference< css::container::XNameAccess > IndexColumns::create(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const css::uno::Reference< css::sdbc::XConnection >  & origin,
     ConnectionSettings *pSettings,
     const OUString &schemaName,
@@ -253,14 +253,14 @@ Reference< css::container::XNameAccess > IndexColumns::create(
 
 
 IndexColumnDescriptors::IndexColumnDescriptors(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings)
     : Container( refMutex, origin, pSettings,  getStatics().INDEX_COLUMN )
 {}
 
 Reference< css::container::XNameAccess > IndexColumnDescriptors::create(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const css::uno::Reference< css::sdbc::XConnection >  & origin,
     ConnectionSettings *pSettings)
 {
@@ -269,7 +269,7 @@ Reference< css::container::XNameAccess > IndexColumnDescriptors::create(
 
 css::uno::Reference< css::beans::XPropertySet > IndexColumnDescriptors::createDataDescriptor()
 {
-    return new IndexColumnDescriptor( m_refMutex, m_origin, m_pSettings );
+    return new IndexColumnDescriptor( m_xMutex, m_origin, m_pSettings );
 }
 
 };
diff --git a/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx b/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx
index 9c1b856dbfd4..f41c390f4ef1 100644
--- a/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx
+++ b/connectivity/source/drivers/postgresql/pq_xindexcolumns.hxx
@@ -51,7 +51,7 @@ class IndexColumns : public Container
 
 public: // instances IndexColumns 'exception safe'
     static css::uno::Reference< css::container::XNameAccess > create(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings,
         const OUString &schemaName,
@@ -61,7 +61,7 @@ public: // instances IndexColumns 'exception safe'
 
 protected:
     IndexColumns(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings,
         const OUString &schemaName,
@@ -92,13 +92,13 @@ class IndexColumnDescriptors : public Container
 
 public: // instances IndexColumns 'exception safe'
     static css::uno::Reference< css::container::XNameAccess > create(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings );
 
 protected:
     IndexColumnDescriptors(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings);
 
diff --git a/connectivity/source/drivers/postgresql/pq_xindexes.cxx b/connectivity/source/drivers/postgresql/pq_xindexes.cxx
index 082a887f1407..126e895d6e19 100644
--- a/connectivity/source/drivers/postgresql/pq_xindexes.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xindexes.cxx
@@ -76,7 +76,7 @@ namespace pq_sdbc_driver
 {
 
 Indexes::Indexes(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings,
         const OUString &schemaName,
@@ -104,7 +104,7 @@ void Indexes::refresh()
             log( m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr() );
         }
 
-        osl::MutexGuard guard( m_refMutex->mutex );
+        osl::MutexGuard guard( m_xMutex->GetMutex() );
         Statics & st = getStatics();
 
         Int2StringMap column2NameMap;
@@ -144,7 +144,7 @@ void Indexes::refresh()
             static const sal_Int32 C_COLUMNS = 7;
             OUString currentIndexName = row->getString( C_INDEXNAME );
             Index *pIndex =
-                new Index( m_refMutex, m_origin, m_pSettings,
+                new Index( m_xMutex, m_origin, m_pSettings,
                            m_schemaName, m_tableName );
 
             (void) C_SCHEMA; (void) C_TABLENAME;
@@ -241,7 +241,7 @@ void Indexes::dropByIndex( sal_Int32 index )
 {
 
 
-    osl::MutexGuard guard( m_refMutex->mutex );
+    osl::MutexGuard guard( m_xMutex->GetMutex() );
     if( index < 0 ||  index >= (sal_Int32)m_values.size() )
     {
         throw css::lang::IndexOutOfBoundsException(
@@ -267,11 +267,11 @@ void Indexes::dropByIndex( sal_Int32 index )
 
 css::uno::Reference< css::beans::XPropertySet > Indexes::createDataDescriptor()
 {
-    return new IndexDescriptor( m_refMutex, m_origin, m_pSettings );
+    return new IndexDescriptor( m_xMutex, m_origin, m_pSettings );
 }
 
 Reference< css::container::XNameAccess > Indexes::create(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const css::uno::Reference< css::sdbc::XConnection >  & origin,
     ConnectionSettings *pSettings,
     const OUString & schemaName,
@@ -285,14 +285,14 @@ Reference< css::container::XNameAccess > Indexes::create(
 
 
 IndexDescriptors::IndexDescriptors(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings)
     : Container( refMutex, origin, pSettings,  getStatics().INDEX )
 {}
 
 Reference< css::container::XNameAccess > IndexDescriptors::create(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const css::uno::Reference< css::sdbc::XConnection >  & origin,
     ConnectionSettings *pSettings)
 {
@@ -301,7 +301,7 @@ Reference< css::container::XNameAccess > IndexDescriptors::create(
 
 css::uno::Reference< css::beans::XPropertySet > IndexDescriptors::createDataDescriptor()
 {
-    return new IndexDescriptor( m_refMutex, m_origin, m_pSettings );
+    return new IndexDescriptor( m_xMutex, m_origin, m_pSettings );
 }
 
 };
diff --git a/connectivity/source/drivers/postgresql/pq_xindexes.hxx b/connectivity/source/drivers/postgresql/pq_xindexes.hxx
index a4d0e48d9467..661c680d67ec 100644
--- a/connectivity/source/drivers/postgresql/pq_xindexes.hxx
+++ b/connectivity/source/drivers/postgresql/pq_xindexes.hxx
@@ -48,7 +48,7 @@ class Indexes : public Container
 
 public: // instances Columns 'exception safe'
     static css::uno::Reference< css::container::XNameAccess > create(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings,
         const OUString &schemaName,
@@ -56,7 +56,7 @@ public: // instances Columns 'exception safe'
 
 protected:
     Indexes(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings,
         const OUString &schemaName,
@@ -83,13 +83,13 @@ class IndexDescriptors : public Container
 {
 public: // instances IndexDescriptors 'exception safe'
     static css::uno::Reference< css::container::XNameAccess > create(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings );
 
 protected:
     IndexDescriptors(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings );
 
diff --git a/connectivity/source/drivers/postgresql/pq_xkey.cxx b/connectivity/source/drivers/postgresql/pq_xkey.cxx
index 0e3ab48782e4..ab7e3768e836 100644
--- a/connectivity/source/drivers/postgresql/pq_xkey.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xkey.cxx
@@ -62,7 +62,7 @@ using com::sun::star::beans::XPropertySet;
 
 namespace pq_sdbc_driver
 {
-Key::Key( const ::rtl::Reference< RefCountedMutex > & refMutex,
+Key::Key( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
           const Reference< css::sdbc::XConnection > & connection,
           ConnectionSettings *pSettings,
           const OUString & schemaName,
@@ -81,7 +81,7 @@ Key::Key( const ::rtl::Reference< RefCountedMutex > & refMutex,
 Reference< XPropertySet > Key::createDataDescriptor(  )
 {
     KeyDescriptor * pKeyDescriptor = new KeyDescriptor(
-        m_refMutex, m_conn, m_pSettings );
+        m_xMutex, m_conn, m_pSettings );
     pKeyDescriptor->copyValuesFrom( this );
 
     return Reference< XPropertySet > ( pKeyDescriptor );
@@ -97,7 +97,7 @@ Reference< XNameAccess > Key::getColumns(  )
         getPropertyValue( getStatics().PRIVATE_FOREIGN_COLUMNS ) >>= foreignColumnNames;
 
         m_keyColumns = KeyColumns::create(
-            m_refMutex, m_conn, m_pSettings, m_schemaName,
+            m_xMutex, m_conn, m_pSettings, m_schemaName,
             m_tableName, columnNames, foreignColumnNames );
     }
     return m_keyColumns;
@@ -138,7 +138,7 @@ Any Key::queryInterface( const Type & reqType )
 }
 
 
-KeyDescriptor::KeyDescriptor( const ::rtl::Reference< RefCountedMutex > & refMutex,
+KeyDescriptor::KeyDescriptor( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
           const Reference< css::sdbc::XConnection > & connection,
           ConnectionSettings *pSettings )
     : ReflectionBase(
@@ -154,7 +154,7 @@ KeyDescriptor::KeyDescriptor( const ::rtl::Reference< RefCountedMutex > & refMut
 Reference< XPropertySet > KeyDescriptor::createDataDescriptor(  )
 {
     KeyDescriptor * pKeyDescriptor = new KeyDescriptor(
-        m_refMutex, m_conn, m_pSettings );
+        m_xMutex, m_conn, m_pSettings );
     pKeyDescriptor->copyValuesFrom( this );
 
     return Reference< XPropertySet > ( pKeyDescriptor );
@@ -165,7 +165,7 @@ Reference< XNameAccess > KeyDescriptor::getColumns(  )
     // TODO: cash columns object !
     if( !m_keyColumns.is() )
     {
-        m_keyColumns = new KeyColumnDescriptors( m_refMutex, m_conn, m_pSettings );
+        m_keyColumns = new KeyColumnDescriptors( m_xMutex, m_conn, m_pSettings );
     }
     return m_keyColumns;
 }
diff --git a/connectivity/source/drivers/postgresql/pq_xkey.hxx b/connectivity/source/drivers/postgresql/pq_xkey.hxx
index 1b22047e89c4..3174d189206b 100644
--- a/connectivity/source/drivers/postgresql/pq_xkey.hxx
+++ b/connectivity/source/drivers/postgresql/pq_xkey.hxx
@@ -59,7 +59,7 @@ class Key : public ReflectionBase,
     OUString m_tableName;
 
 public:
-    Key( const ::rtl::Reference< RefCountedMutex > & refMutex,
+    Key( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
          const css::uno::Reference< css::sdbc::XConnection > & connection,
          ConnectionSettings *pSettings,
          const OUString &schemaName,
@@ -91,7 +91,7 @@ class KeyDescriptor : public ReflectionBase, public css::sdbcx::XColumnsSupplier
     css::uno::Reference< css::container::XNameAccess > m_keyColumns;
 
 public:
-    KeyDescriptor( const ::rtl::Reference< RefCountedMutex > & refMutex,
+    KeyDescriptor( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
          const css::uno::Reference< css::sdbc::XConnection > & connection,
          ConnectionSettings *pSettings );
 
diff --git a/connectivity/source/drivers/postgresql/pq_xkeycolumn.cxx b/connectivity/source/drivers/postgresql/pq_xkeycolumn.cxx
index 57c4f400067a..c7ffbcd3d6f2 100644
--- a/connectivity/source/drivers/postgresql/pq_xkeycolumn.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xkeycolumn.cxx
@@ -45,7 +45,7 @@ using com::sun::star::beans::XPropertySet;
 
 namespace pq_sdbc_driver
 {
-KeyColumn::KeyColumn( const ::rtl::Reference< RefCountedMutex > & refMutex,
+KeyColumn::KeyColumn( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
                       const Reference< css::sdbc::XConnection > & connection,
                       ConnectionSettings *pSettings)
     : ReflectionBase(
@@ -60,14 +60,14 @@ KeyColumn::KeyColumn( const ::rtl::Reference< RefCountedMutex > & refMutex,
 Reference< XPropertySet > KeyColumn::createDataDescriptor(  )
 {
     KeyColumnDescriptor * pKeyColumn = new KeyColumnDescriptor(
-        m_refMutex, m_conn, m_pSettings );
+        m_xMutex, m_conn, m_pSettings );
     pKeyColumn->copyValuesFrom( this );
 
     return Reference< XPropertySet > ( pKeyColumn );
 }
 
 KeyColumnDescriptor::KeyColumnDescriptor(
-    const ::rtl::Reference< RefCountedMutex > & refMutex,
+    const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
     const Reference< css::sdbc::XConnection > & connection,
     ConnectionSettings *pSettings)
     : ReflectionBase(
@@ -82,7 +82,7 @@ KeyColumnDescriptor::KeyColumnDescriptor(
 Reference< XPropertySet > KeyColumnDescriptor::createDataDescriptor(  )
 {
     KeyColumnDescriptor * pKeyColumn = new KeyColumnDescriptor(
-        m_refMutex, m_conn, m_pSettings );
+        m_xMutex, m_conn, m_pSettings );
     pKeyColumn->copyValuesFrom( this );
 
     return Reference< XPropertySet > ( pKeyColumn );
diff --git a/connectivity/source/drivers/postgresql/pq_xkeycolumn.hxx b/connectivity/source/drivers/postgresql/pq_xkeycolumn.hxx
index bf102777b730..14baf7f66cf2 100644
--- a/connectivity/source/drivers/postgresql/pq_xkeycolumn.hxx
+++ b/connectivity/source/drivers/postgresql/pq_xkeycolumn.hxx
@@ -52,7 +52,7 @@ namespace pq_sdbc_driver
 class KeyColumn : public ReflectionBase
 {
 public:
-    KeyColumn( const ::rtl::Reference< RefCountedMutex > & refMutex,
+    KeyColumn( const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
                const css::uno::Reference< css::sdbc::XConnection > & connection,
                ConnectionSettings *pSettings);
 
@@ -66,7 +66,7 @@ class KeyColumnDescriptor : public ReflectionBase
 {
 public:
     KeyColumnDescriptor(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection > & connection,
         ConnectionSettings *pSettings);
 
diff --git a/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx b/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx
index 62dbc334d461..0ae1af1ffdb2 100644
--- a/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx
+++ b/connectivity/source/drivers/postgresql/pq_xkeycolumns.cxx
@@ -68,7 +68,7 @@ namespace pq_sdbc_driver
 {
 
 KeyColumns::KeyColumns(
-        const ::rtl::Reference< RefCountedMutex > & refMutex,
+        const ::rtl::Reference< comphelper::RefCountedMutex > & refMutex,
         const css::uno::Reference< css::sdbc::XConnection >  & origin,
         ConnectionSettings *pSettings,
         const OUString &schemaName,
@@ -100,7 +100,7 @@ void KeyColumns::refresh()
             log( m_pSettings, LogLevel::Info, buf.makeStringAndClear().getStr() );
         }
 
-        osl::MutexGuard guard( m_refMutex->mutex );

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list