framework/source/uiconfiguration/imagemanagerimpl.cxx |   14 +++++++-------
 i18npool/source/search/textsearch.cxx                 |    8 +++-----
 i18npool/source/search/textsearch.hxx                 |    3 ++-
 3 files changed, 12 insertions(+), 13 deletions(-)

New commits:
commit a08f3b10550761d637d27f5d88d554bd949417df
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Dec 18 20:07:29 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Dec 20 17:52:30 2021 +0100

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

diff --git a/framework/source/uiconfiguration/imagemanagerimpl.cxx 
b/framework/source/uiconfiguration/imagemanagerimpl.cxx
index ae8a5b310fcc..a847ee35ff68 100644
--- a/framework/source/uiconfiguration/imagemanagerimpl.cxx
+++ b/framework/source/uiconfiguration/imagemanagerimpl.cxx
@@ -85,15 +85,15 @@ namespace framework
 
 static GlobalImageList*     pGlobalImageList = nullptr;
 
-static osl::Mutex& getGlobalImageListMutex()
+static std::mutex& getGlobalImageListMutex()
 {
-    static osl::Mutex mutex;
+    static std::mutex mutex;
     return mutex;
 }
 
 static GlobalImageList* getGlobalImageList( const uno::Reference< 
uno::XComponentContext >& rxContext )
 {
-    osl::MutexGuard guard( getGlobalImageListMutex() );
+    std::unique_lock guard( getGlobalImageListMutex() );
 
     if ( pGlobalImageList == nullptr )
         pGlobalImageList = new GlobalImageList( rxContext );
@@ -183,26 +183,26 @@ GlobalImageList::GlobalImageList( const uno::Reference< 
uno::XComponentContext >
 
 GlobalImageList::~GlobalImageList()
 {
-    osl::MutexGuard guard( getGlobalImageListMutex() );
+    std::unique_lock guard( getGlobalImageListMutex() );
     // remove global pointer as we destroy the object now
     pGlobalImageList = nullptr;
 }
 
 Image GlobalImageList::getImageFromCommandURL( vcl::ImageType nImageType, 
const OUString& rCommandURL )
 {
-    osl::MutexGuard guard( getGlobalImageListMutex() );
+    std::unique_lock guard( getGlobalImageListMutex() );
     return CmdImageList::getImageFromCommandURL( nImageType, rCommandURL );
 }
 
 bool GlobalImageList::hasImage( vcl::ImageType nImageType, const OUString& 
rCommandURL )
 {
-    osl::MutexGuard guard( getGlobalImageListMutex() );
+    std::unique_lock guard( getGlobalImageListMutex() );
     return CmdImageList::hasImage( nImageType, rCommandURL );
 }
 
 ::std::vector< OUString >& GlobalImageList::getImageCommandNames()
 {
-    osl::MutexGuard guard( getGlobalImageListMutex() );
+    std::unique_lock guard( getGlobalImageListMutex() );
     return CmdImageList::getImageCommandNames();
 }
 
commit 361b1aaae1d69a642e2735c862d4fe9243ea4646
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sat Dec 18 20:49:00 2021 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Dec 20 17:52:17 2021 +0100

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

diff --git a/i18npool/source/search/textsearch.cxx 
b/i18npool/source/search/textsearch.cxx
index c5e48a12b4c0..1df286dfcd35 100644
--- a/i18npool/source/search/textsearch.cxx
+++ b/i18npool/source/search/textsearch.cxx
@@ -116,7 +116,7 @@ TextSearch::~TextSearch()
 
 void TextSearch::setOptions2( const SearchOptions2& rOptions )
 {
-    osl::MutexGuard g(m_aMutex);
+    std::unique_lock g(m_aMutex);
 
     aSrchPara = rOptions;
 
@@ -264,8 +264,6 @@ void TextSearch::setOptions2( const SearchOptions2& 
rOptions )
 
 void TextSearch::setOptions( const SearchOptions& rOptions )
 {
-    osl::MutexGuard g(m_aMutex);
-
     sal_Int16 nAlgorithmType2;
     switch (rOptions.algorithmType)
     {
@@ -316,7 +314,7 @@ bool TextSearch::isCellStart(const OUString& searchStr, 
sal_Int32 nPos)
 
 SearchResult TextSearch::searchForward( const OUString& searchStr, sal_Int32 
startPos, sal_Int32 endPos )
 {
-    osl::MutexGuard g(m_aMutex);
+    std::unique_lock g(m_aMutex);
 
     SearchResult sres;
 
@@ -455,7 +453,7 @@ SearchResult TextSearch::searchForward( const OUString& 
searchStr, sal_Int32 sta
 
 SearchResult TextSearch::searchBackward( const OUString& searchStr, sal_Int32 
startPos, sal_Int32 endPos )
 {
-    osl::MutexGuard g(m_aMutex);
+    std::unique_lock g(m_aMutex);
 
     SearchResult sres;
 
diff --git a/i18npool/source/search/textsearch.hxx 
b/i18npool/source/search/textsearch.hxx
index 5b3dcd05179e..d03a1047769b 100644
--- a/i18npool/source/search/textsearch.hxx
+++ b/i18npool/source/search/textsearch.hxx
@@ -26,6 +26,7 @@
 
 #include <map>
 #include <memory>
+#include <mutex>
 
 #include <unicode/regex.h>
 #include <unicode/unistr.h>
@@ -48,7 +49,7 @@ class TextSearch: public cppu::WeakImplHelper
     css::lang::XServiceInfo
 >
 {
-    osl::Mutex m_aMutex;
+    std::mutex m_aMutex;
     css::uno::Reference < css::uno::XComponentContext > m_xContext;
 
     css::util::SearchOptions2 aSrchPara;

Reply via email to