diff options
author | Arnaud Versini <arnaud.versini@libreoffice.org> | 2021-01-03 12:49:37 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-03-07 13:37:19 +0100 |
commit | 08cb09c092f503c43d93b9e8c816dd5412d2d917 (patch) | |
tree | 3d1846e73f3a0962d74ea7ba643049f98a04df19 /basic | |
parent | 9129dd6f168d9bc2a303edb4469f0590a8234059 (diff) |
BASIC : use standard mutex from std.
Change-Id: Ie9abb32124b8718bbfde076f090180794c64f90e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108629
Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/errobject.cxx | 8 | ||||
-rw-r--r-- | basic/source/runtime/basrdll.cxx | 10 |
2 files changed, 12 insertions, 6 deletions
diff --git a/basic/source/classes/errobject.cxx b/basic/source/classes/errobject.cxx index b961e16983f7..85423101b827 100644 --- a/basic/source/classes/errobject.cxx +++ b/basic/source/classes/errobject.cxx @@ -17,6 +17,10 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <mutex> + #include <errobject.hxx> #include <sbxbase.hxx> @@ -195,8 +199,8 @@ SbxErrObject::getErrObject() { SbxVariableRef& rGlobErr = GetSbxData_Impl().m_aGlobErr; { - static osl::Mutex aMutex; - osl::MutexGuard aGuard(aMutex); + static std::mutex aMutex; + std::scoped_lock aGuard(aMutex); if (!rGlobErr) rGlobErr = new SbxErrObject("Err", uno::Any(uno::Reference<vba::XErrObject>(new ErrObject()))); diff --git a/basic/source/runtime/basrdll.cxx b/basic/source/runtime/basrdll.cxx index 29cd292e2bdf..ba94fd7b9d2b 100644 --- a/basic/source/runtime/basrdll.cxx +++ b/basic/source/runtime/basrdll.cxx @@ -18,6 +18,8 @@ */ #include <memory> +#include <mutex> + #include <vcl/svapp.hxx> #include <tools/debug.hxx> #include <vcl/weld.hxx> @@ -44,9 +46,9 @@ struct BasicDLLImpl : public SvRefBase { } static BasicDLLImpl* BASIC_DLL; - static osl::Mutex& getMutex() + static std::mutex& getMutex() { - static osl::Mutex aMutex; + static std::mutex aMutex; return aMutex; } }; @@ -56,7 +58,7 @@ BasicDLLImpl* BasicDLLImpl::BASIC_DLL = nullptr; BasicDLL::BasicDLL() { - osl::MutexGuard aGuard(BasicDLLImpl::getMutex()); + std::scoped_lock aGuard(BasicDLLImpl::getMutex()); if (!BasicDLLImpl::BASIC_DLL) BasicDLLImpl::BASIC_DLL = new BasicDLLImpl; m_xImpl = BasicDLLImpl::BASIC_DLL; @@ -64,7 +66,7 @@ BasicDLL::BasicDLL() BasicDLL::~BasicDLL() { - osl::MutexGuard aGuard(BasicDLLImpl::getMutex()); + std::scoped_lock aGuard(BasicDLLImpl::getMutex()); const bool bLastRef = m_xImpl->GetRefCount() == 1; if (bLastRef) { BasicDLLImpl::BASIC_DLL->xSbxAppData->m_aGlobErr.clear(); |