bridges/inc/msvc/except.hxx | 3 ++- bridges/source/cpp_uno/msvc_shared/except.cxx | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
New commits: commit 7c035ff67993707cfd09c575a97028dab9683557 Author: Noel Grandin <noelgran...@collabora.co.uk> AuthorDate: Wed Feb 1 15:54:20 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Feb 1 17:09:12 2023 +0000 osl::Mutex->std::mutex in ExceptionInfos Change-Id: Ic947b58b9aba121c605b6795c7cd9aa0b16b180e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146455 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/bridges/inc/msvc/except.hxx b/bridges/inc/msvc/except.hxx index 798fc44f147c..f1403a43af88 100644 --- a/bridges/inc/msvc/except.hxx +++ b/bridges/inc/msvc/except.hxx @@ -26,6 +26,7 @@ #include <rtl/ustrbuf.hxx> #include <osl/mutex.hxx> +#include <mutex> #include <unordered_map> typedef struct _uno_Any uno_Any; @@ -101,7 +102,7 @@ public: class ExceptionInfos final { - osl::Mutex m_aMutex; + std::mutex m_aMutex; t_string2PtrMap m_allRaiseInfos; public: diff --git a/bridges/source/cpp_uno/msvc_shared/except.cxx b/bridges/source/cpp_uno/msvc_shared/except.cxx index 283baa75173c..f76533fa160e 100644 --- a/bridges/source/cpp_uno/msvc_shared/except.cxx +++ b/bridges/source/cpp_uno/msvc_shared/except.cxx @@ -131,7 +131,7 @@ ExceptionInfos::~ExceptionInfos() noexcept { SAL_INFO("bridges", "> freeing exception infos... <"); - osl::MutexGuard aGuard(m_aMutex); + std::unique_lock aGuard(m_aMutex); for (auto& rEntry : m_allRaiseInfos) delete static_cast<RaiseInfo*>(rEntry.second); } @@ -154,7 +154,7 @@ RaiseInfo* ExceptionInfos::getRaiseInfo(typelib_TypeDescription* pTD) noexcept RaiseInfo* pRaiseInfo; OUString const& rTypeName = OUString::unacquired(&pTD->pTypeName); - osl::MutexGuard aGuard(s_pInfos->m_aMutex); + std::unique_lock aGuard(s_pInfos->m_aMutex); t_string2PtrMap::const_iterator const iFind(s_pInfos->m_allRaiseInfos.find(rTypeName)); if (iFind != s_pInfos->m_allRaiseInfos.end()) pRaiseInfo = static_cast<RaiseInfo*>(iFind->second);