dbaccess/source/ui/browser/genericcontroller.cxx |   12 ++++++------
 include/dbaccess/genericcontroller.hxx           |    3 ++-
 sd/source/ui/tools/SdGlobalResourceContainer.cxx |   11 ++++++-----
 3 files changed, 14 insertions(+), 12 deletions(-)

New commits:
commit a979535eeb1630334b60eea98be2c2fabec56c23
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Feb 17 13:25:39 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Feb 18 20:40:17 2023 +0000

    osl::Mutex->std::mutex in OGenericUnoController
    
    Change-Id: If49864f3127b185bb0212be02abd0f92e14c3908
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147261
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/dbaccess/source/ui/browser/genericcontroller.cxx 
b/dbaccess/source/ui/browser/genericcontroller.cxx
index 5c4423227784..a5c8afbb306b 100644
--- a/dbaccess/source/ui/browser/genericcontroller.cxx
+++ b/dbaccess/source/ui/browser/genericcontroller.cxx
@@ -459,7 +459,7 @@ void OGenericUnoController::InvalidateFeature_Impl()
     bool bEmpty = true;
     FeatureListener aNextFeature;
     {
-        ::osl::MutexGuard aGuard( m_aFeatureMutex);
+        std::unique_lock aGuard( m_aFeatureMutex);
         bEmpty = m_aFeaturesToInvalidate.empty();
         if (!bEmpty)
             aNextFeature = m_aFeaturesToInvalidate.front();
@@ -492,7 +492,7 @@ void OGenericUnoController::InvalidateFeature_Impl()
                 ImplBroadcastFeatureState( aFeaturePos->first, 
aNextFeature.xListener, aNextFeature.bForceBroadcast );
         }
 
-        ::osl::MutexGuard aGuard( m_aFeatureMutex);
+        std::unique_lock aGuard( m_aFeatureMutex);
         m_aFeaturesToInvalidate.pop_front();
         bEmpty = m_aFeaturesToInvalidate.empty();
         if (!bEmpty)
@@ -521,7 +521,7 @@ void OGenericUnoController::ImplInvalidateFeature( 
sal_Int32 _nId, const Referen
 
     bool bWasEmpty;
     {
-        ::osl::MutexGuard aGuard( m_aFeatureMutex );
+        std::unique_lock aGuard( m_aFeatureMutex );
         bWasEmpty = m_aFeaturesToInvalidate.empty();
         m_aFeaturesToInvalidate.push_back( aListener );
     }
@@ -547,7 +547,7 @@ void OGenericUnoController::InvalidateAll_Impl()
         ImplBroadcastFeatureState( supportedFeature.first, nullptr, true );
 
     {
-        ::osl::MutexGuard aGuard( m_aFeatureMutex);
+        std::unique_lock aGuard( m_aFeatureMutex);
         OSL_ENSURE(m_aFeaturesToInvalidate.size(), 
"OGenericUnoController::InvalidateAll_Impl: to be called from within 
InvalidateFeature_Impl only!");
         m_aFeaturesToInvalidate.pop_front();
         if(!m_aFeaturesToInvalidate.empty())
@@ -680,7 +680,7 @@ void OGenericUnoController::removeStatusListener(const 
Reference< XStatusListene
     }
 
     // now remove the listener from the deque
-    ::osl::MutexGuard aGuard( m_aFeatureMutex );
+    std::unique_lock aGuard( m_aFeatureMutex );
     m_aFeaturesToInvalidate.erase(
         std::remove_if(   m_aFeaturesToInvalidate.begin(),
                             m_aFeaturesToInvalidate.end(),
@@ -717,7 +717,7 @@ void OGenericUnoController::disposing()
 
     m_xDatabaseContext = nullptr;
     {
-        ::osl::MutexGuard aGuard( m_aFeatureMutex);
+        std::unique_lock aGuard( m_aFeatureMutex);
         m_aAsyncInvalidateAll.CancelCall();
         m_aFeaturesToInvalidate.clear();
     }
diff --git a/include/dbaccess/genericcontroller.hxx 
b/include/dbaccess/genericcontroller.hxx
index 0eb6a94ad703..6ef9393c2f9a 100644
--- a/include/dbaccess/genericcontroller.hxx
+++ b/include/dbaccess/genericcontroller.hxx
@@ -25,6 +25,7 @@
 #include <deque>
 #include <map>
 #include <memory>
+#include <mutex>
 #include <utility>
 #include <vector>
 
@@ -233,7 +234,7 @@ namespace dbaui
         ::std::deque< FeatureListener >
                                 m_aFeaturesToInvalidate;
 
-        ::osl::Mutex            m_aFeatureMutex;        // locked when 
features are append to or remove from deque
+        std::mutex              m_aFeatureMutex;        // locked when 
features are append to or remove from deque
         StateCache              m_aStateCache;          // save the current 
status of feature state
         Dispatch                m_arrStatusListener;    // all our listeners 
where we dispatch status changes
         OAsynchronousLink       m_aAsyncInvalidateAll;
commit 4a4223f924d4ec49b023a85ce37f3788bc699723
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Feb 17 15:05:54 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Feb 18 20:40:05 2023 +0000

    osl::Mutex->std::mutex in SdGlobalResourceContainer
    
    Change-Id: I521ec7397e9ac54547bc82be6579cbb4fb4fc5a8
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147266
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/sd/source/ui/tools/SdGlobalResourceContainer.cxx 
b/sd/source/ui/tools/SdGlobalResourceContainer.cxx
index a7dbc5f25920..7f692caa157c 100644
--- a/sd/source/ui/tools/SdGlobalResourceContainer.cxx
+++ b/sd/source/ui/tools/SdGlobalResourceContainer.cxx
@@ -31,6 +31,7 @@
 
 #include <algorithm>
 #include <memory>
+#include <mutex>
 #include <vector>
 
 using namespace ::com::sun::star;
@@ -67,7 +68,7 @@ class SdGlobalResourceContainer::Implementation
 private:
     friend class SdGlobalResourceContainer;
 
-    ::osl::Mutex maMutex;
+    std::mutex maMutex;
 
     /** All instances of SdGlobalResource in this vector are owned by the
         container and will be destroyed when the container is destroyed.
@@ -94,7 +95,7 @@ SdGlobalResourceContainer& 
SdGlobalResourceContainer::Instance()
 void SdGlobalResourceContainer::AddResource (
     ::std::unique_ptr<SdGlobalResource> pResource)
 {
-    ::osl::MutexGuard aGuard (mpImpl->maMutex);
+    std::unique_lock aGuard (mpImpl->maMutex);
 
     assert( std::none_of(
                 mpImpl->maResources.begin(),
@@ -108,7 +109,7 @@ void SdGlobalResourceContainer::AddResource (
 void SdGlobalResourceContainer::AddResource (
     const std::shared_ptr<SdGlobalResource>& pResource)
 {
-    ::osl::MutexGuard aGuard (mpImpl->maMutex);
+    std::unique_lock aGuard (mpImpl->maMutex);
 
     Implementation::SharedResourceList::iterator iResource = ::std::find (
         mpImpl->maSharedResources.begin(),
@@ -125,7 +126,7 @@ void SdGlobalResourceContainer::AddResource (
 
 void SdGlobalResourceContainer::AddResource (const Reference<XInterface>& 
rxResource)
 {
-    ::osl::MutexGuard aGuard (mpImpl->maMutex);
+    std::unique_lock aGuard (mpImpl->maMutex);
 
     Implementation::XInterfaceResourceList::iterator iResource = ::std::find (
         mpImpl->maXInterfaceResources.begin(),
@@ -147,7 +148,7 @@ SdGlobalResourceContainer::SdGlobalResourceContainer()
 
 SdGlobalResourceContainer::~SdGlobalResourceContainer()
 {
-    ::osl::MutexGuard aGuard (mpImpl->maMutex);
+    std::unique_lock aGuard (mpImpl->maMutex);
 
     // Release the resources in reversed order of their addition to the
     // container.  This is because a resource A added before resource B

Reply via email to