diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-07-18 15:04:41 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-18 20:47:06 +0200 |
commit | 2b9afb52a96b86cb6f1aab2bdccca3b19566a8c7 (patch) | |
tree | cc0a98fdd1f413aae0d2cb68c35f3b2fc8a0d584 /linguistic | |
parent | 4ab57949a2cbaacba33375ea33dc896205eac6c9 (diff) |
osl::Mutex->std::mutex in linguistic
Change-Id: I9cbd3da16fa122de2f1087be11969cb204aef020
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119141
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'linguistic')
-rw-r--r-- | linguistic/source/misc.cxx | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/linguistic/source/misc.cxx b/linguistic/source/misc.cxx index 59214bed4500..ac9ad9de37e9 100644 --- a/linguistic/source/misc.cxx +++ b/linguistic/source/misc.cxx @@ -46,6 +46,7 @@ #include <linguistic/misc.hxx> #include <linguistic/hyphdta.hxx> +#include <mutex> using namespace osl; using namespace com::sun::star; @@ -571,15 +572,11 @@ static CharClass & lcl_GetCharClass() return aCC; } -static osl::Mutex & lcl_GetCharClassMutex() -{ - static osl::Mutex aMutex; - return aMutex; -} +static std::mutex s_GetCharClassMutex; bool IsUpper( const OUString &rText, sal_Int32 nPos, sal_Int32 nLen, LanguageType nLanguage ) { - MutexGuard aGuard( lcl_GetCharClassMutex() ); + std::lock_guard aGuard( s_GetCharClassMutex ); CharClass &rCC = lcl_GetCharClass(); rCC.setLanguageTag( LanguageTag( nLanguage )); @@ -615,7 +612,7 @@ CapType capitalType(const OUString& aTerm, CharClass const * pCC) OUString ToLower( const OUString &rText, LanguageType nLanguage ) { - MutexGuard aGuard( lcl_GetCharClassMutex() ); + std::lock_guard aGuard( s_GetCharClassMutex ); CharClass &rCC = lcl_GetCharClass(); rCC.setLanguageTag( LanguageTag( nLanguage )); |