diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-12-23 19:39:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-12-25 09:28:23 +0100 |
commit | f5ba1d0aa5850d5c2a2e267c89ad60885144ae28 (patch) | |
tree | 3050f05e10cd44d8d47bf2673e264f1798791550 /unotools | |
parent | ebdc45cda44618c4f165f01de2a5466ee6fb2242 (diff) |
osl::Mutex->std::mutex in SvtPathOptions
Change-Id: Ibf0aef2116e6ee7ab1cdc0de2b2bb502a8ce05e1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127417
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'unotools')
-rw-r--r-- | unotools/source/config/pathoptions.cxx | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/unotools/source/config/pathoptions.cxx b/unotools/source/config/pathoptions.cxx index e7793d07321c..27ddbed79c24 100644 --- a/unotools/source/config/pathoptions.cxx +++ b/unotools/source/config/pathoptions.cxx @@ -434,9 +434,9 @@ SvtPathOptions_Impl::SvtPathOptions_Impl() namespace { - ::osl::Mutex& lclMutex() + std::mutex& lclMutex() { - static ::osl::Mutex SINGLETON; + static std::mutex SINGLETON; return SINGLETON; } } @@ -444,12 +444,13 @@ namespace SvtPathOptions::SvtPathOptions() { // Global access, must be guarded (multithreading) - ::osl::MutexGuard aGuard( lclMutex() ); + std::unique_lock aGuard( lclMutex() ); pImpl = g_pOptions.lock(); if ( !pImpl ) { pImpl = std::make_shared<SvtPathOptions_Impl>(); g_pOptions = pImpl; + aGuard.unlock(); // because holdConfigItem will call this constructor ItemHolder1::holdConfigItem(EItem::PathOptions); } } @@ -457,7 +458,7 @@ SvtPathOptions::SvtPathOptions() SvtPathOptions::~SvtPathOptions() { // Global access, must be guarded (multithreading) - ::osl::MutexGuard aGuard( lclMutex() ); + std::unique_lock aGuard( lclMutex() ); pImpl.reset(); } |