diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-10 15:04:59 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-03-11 05:54:08 +0000 |
commit | 72c05eda32286703ec8315d05686d46ae824e194 (patch) | |
tree | 54590129c7a6a66de5d6063c2451f0b50a670a2a /connectivity | |
parent | 5126c94cea90251f73b7b383e23ffa473ac5f5f0 (diff) |
osl::Mutex->std::mutex in OConnectionPool
Change-Id: Icc0fc8162321296307f2b01e3fe39be3a69d5d10
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148659
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/cpool/ZConnectionPool.cxx | 8 | ||||
-rw-r--r-- | connectivity/source/cpool/ZConnectionPool.hxx | 3 |
2 files changed, 6 insertions, 5 deletions
diff --git a/connectivity/source/cpool/ZConnectionPool.cxx b/connectivity/source/cpool/ZConnectionPool.cxx index 23e6dda1d226..7d4ea408d4b6 100644 --- a/connectivity/source/cpool/ZConnectionPool.cxx +++ b/connectivity/source/cpool/ZConnectionPool.cxx @@ -129,7 +129,7 @@ struct TConnectionPoolFunctor void OConnectionPool::clear(bool _bDispose) { - MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); if(m_xInvalidator->isTicking()) m_xInvalidator->stop(); @@ -153,7 +153,7 @@ void OConnectionPool::clear(bool _bDispose) Reference< XConnection > OConnectionPool::getConnectionWithInfo( const OUString& _rURL, const Sequence< PropertyValue >& _rInfo ) { - MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); Reference<XConnection> xConnection; @@ -177,7 +177,7 @@ void SAL_CALL OConnectionPool::disposing( const css::lang::EventObject& Source ) Reference<XConnection> xConnection(Source.Source,UNO_QUERY); if(xConnection.is()) { - MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); TActiveConnectionMap::iterator aIter = m_aActiveConnections.find(xConnection); OSL_ENSURE(aIter != m_aActiveConnections.end(),"OConnectionPool::disposing: Connection wasn't in pool"); if(aIter != m_aActiveConnections.end()) @@ -228,7 +228,7 @@ Reference< XConnection> OConnectionPool::createNewConnection(const OUString& _rU void OConnectionPool::invalidatePooledConnections() { - MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); TConnectionMap::iterator aIter = m_aPool.begin(); for (; aIter != m_aPool.end(); ) { diff --git a/connectivity/source/cpool/ZConnectionPool.hxx b/connectivity/source/cpool/ZConnectionPool.hxx index e83d22849c0e..1d07920d0114 100644 --- a/connectivity/source/cpool/ZConnectionPool.hxx +++ b/connectivity/source/cpool/ZConnectionPool.hxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <map> +#include <mutex> #include <vector> #include <com/sun/star/sdbc/XPooledConnection.hpp> @@ -105,7 +106,7 @@ namespace connectivity TConnectionMap m_aPool; // the pooled connections TActiveConnectionMap m_aActiveConnections; // the currently active connections - ::osl::Mutex m_aMutex; + std::mutex m_aMutex; ::rtl::Reference<OPoolTimer> m_xInvalidator; // invalidates the conntection pool when shot css::uno::Reference< css::sdbc::XDriver > m_xDriver; // the one and only driver for this connectionpool |