comphelper/source/misc/officerestartmanager.cxx |    4 ++--
 comphelper/source/misc/officerestartmanager.hxx |    4 ++--
 connectivity/source/cpool/ZConnectionPool.cxx   |    8 ++++----
 connectivity/source/cpool/ZConnectionPool.hxx   |    3 ++-
 4 files changed, 10 insertions(+), 9 deletions(-)

New commits:
commit 72c05eda32286703ec8315d05686d46ae824e194
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Mar 10 15:04:59 2023 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Mar 11 05:54:08 2023 +0000

    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 <[email protected]>

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
commit 5126c94cea90251f73b7b383e23ffa473ac5f5f0
Author:     Noel Grandin <[email protected]>
AuthorDate: Fri Mar 10 14:05:01 2023 +0200
Commit:     Noel Grandin <[email protected]>
CommitDate: Sat Mar 11 05:53:57 2023 +0000

    osl::Mutex->std::mutex in OOfficeRestartManager
    
    Change-Id: I473d604346280cb24c299e0e6d6ca2621a2200a9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/148658
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <[email protected]>

diff --git a/comphelper/source/misc/officerestartmanager.cxx 
b/comphelper/source/misc/officerestartmanager.cxx
index 39c61a4e53a3..86eb18f623c9 100644
--- a/comphelper/source/misc/officerestartmanager.cxx
+++ b/comphelper/source/misc/officerestartmanager.cxx
@@ -39,7 +39,7 @@ void SAL_CALL OOfficeRestartManager::requestRestart( const 
uno::Reference< task:
         throw uno::RuntimeException();
 
     {
-        ::osl::MutexGuard aGuard( m_aMutex );
+        std::unique_lock aGuard( m_aMutex );
 
         // if the restart already running there is no need to trigger it again
         if ( m_bRestartRequested )
@@ -76,7 +76,7 @@ void SAL_CALL OOfficeRestartManager::requestRestart( const 
uno::Reference< task:
 
 sal_Bool SAL_CALL OOfficeRestartManager::isRestartRequested( sal_Bool 
bOfficeInitialized )
 {
-    ::osl::MutexGuard aGuard( m_aMutex );
+    std::unique_lock aGuard( m_aMutex );
 
     if ( bOfficeInitialized && !m_bOfficeInitialized )
         m_bOfficeInitialized = bOfficeInitialized;
diff --git a/comphelper/source/misc/officerestartmanager.hxx 
b/comphelper/source/misc/officerestartmanager.hxx
index bc95668b9399..ecf59c543270 100644
--- a/comphelper/source/misc/officerestartmanager.hxx
+++ b/comphelper/source/misc/officerestartmanager.hxx
@@ -24,7 +24,7 @@
 #include <com/sun/star/awt/XCallback.hpp>
 #include <com/sun/star/uno/XComponentContext.hpp>
 
-#include <osl/mutex.hxx>
+#include <mutex>
 #include <cppuhelper/implbase.hxx>
 #include <utility>
 
@@ -35,7 +35,7 @@ class OOfficeRestartManager : public ::cppu::WeakImplHelper< 
css::task::XRestart
                                                            , 
css::awt::XCallback
                                                            , 
css::lang::XServiceInfo >
 {
-    ::osl::Mutex m_aMutex;
+    std::mutex m_aMutex;
     css::uno::Reference< css::uno::XComponentContext > m_xContext;
 
     bool m_bOfficeInitialized;

Reply via email to