summaryrefslogtreecommitdiff
path: root/linguistic
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-07-18 15:04:41 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-18 20:47:06 +0200
commit2b9afb52a96b86cb6f1aab2bdccca3b19566a8c7 (patch)
treecc0a98fdd1f413aae0d2cb68c35f3b2fc8a0d584 /linguistic
parent4ab57949a2cbaacba33375ea33dc896205eac6c9 (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.cxx11
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 ));