[Libreoffice-commits] core.git: lingucomponent/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 31 12:25:14 UTC 2021


 lingucomponent/source/languageguessing/guesslang.cxx |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit e81be03d9f2c952da0516be0f42fd2dbe6f6d4a4
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 30 15:31:22 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jul 31 14:24:40 2021 +0200

    osl::Mutex->std::mutex in LangGuess_Impl
    
    Change-Id: If2ea21cd52ddae821598398524c84b5b22817c33
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119729
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/lingucomponent/source/languageguessing/guesslang.cxx b/lingucomponent/source/languageguessing/guesslang.cxx
index dfece0efe4e5..98274af16d46 100644
--- a/lingucomponent/source/languageguessing/guesslang.cxx
+++ b/lingucomponent/source/languageguessing/guesslang.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <iostream>
+#include <mutex>
 #include <string_view>
 
 #include <osl/file.hxx>
@@ -54,9 +55,9 @@ using namespace ::com::sun::star::uno;
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::linguistic2;
 
-static osl::Mutex &  GetLangGuessMutex()
+static std::mutex & GetLangGuessMutex()
 {
-    static osl::Mutex aMutex;
+    static std::mutex aMutex;
     return aMutex;
 }
 
@@ -160,7 +161,7 @@ Locale SAL_CALL LangGuess_Impl::guessPrimaryLanguage(
         ::sal_Int32 nStartPos,
         ::sal_Int32 nLen )
 {
-    osl::MutexGuard aGuard( GetLangGuessMutex() );
+    std::lock_guard aGuard( GetLangGuessMutex() );
 
     EnsureInitialized();
 
@@ -189,7 +190,7 @@ void LangGuess_Impl::SetFingerPrintsDB(
 
 uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getAvailableLanguages(  )
 {
-    osl::MutexGuard aGuard( GetLangGuessMutex() );
+    std::lock_guard aGuard( GetLangGuessMutex() );
 
     EnsureInitialized();
 
@@ -211,7 +212,7 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getAvailableLanguages(  )
 
 uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getEnabledLanguages(  )
 {
-    osl::MutexGuard aGuard( GetLangGuessMutex() );
+    std::lock_guard aGuard( GetLangGuessMutex() );
 
     EnsureInitialized();
 
@@ -233,7 +234,7 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getEnabledLanguages(  )
 
 uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getDisabledLanguages(  )
 {
-    osl::MutexGuard aGuard( GetLangGuessMutex() );
+    std::lock_guard aGuard( GetLangGuessMutex() );
 
     EnsureInitialized();
 
@@ -256,7 +257,7 @@ uno::Sequence< Locale > SAL_CALL LangGuess_Impl::getDisabledLanguages(  )
 void SAL_CALL LangGuess_Impl::disableLanguages(
         const uno::Sequence< Locale >& rLanguages )
 {
-    osl::MutexGuard aGuard( GetLangGuessMutex() );
+    std::lock_guard aGuard( GetLangGuessMutex() );
 
     EnsureInitialized();
 
@@ -277,7 +278,7 @@ void SAL_CALL LangGuess_Impl::disableLanguages(
 void SAL_CALL LangGuess_Impl::enableLanguages(
         const uno::Sequence< Locale >& rLanguages )
 {
-    osl::MutexGuard aGuard( GetLangGuessMutex() );
+    std::lock_guard aGuard( GetLangGuessMutex() );
 
     EnsureInitialized();
 


More information about the Libreoffice-commits mailing list