sw/source/core/docnode/swthreadjoiner.cxx | 6 +++--- sw/source/core/unocore/unoframe.cxx | 19 +++++++++---------- 2 files changed, 12 insertions(+), 13 deletions(-)
New commits: commit 15314d2d28535d1baa9694f9d01cb8b34cf6f0d2 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Tue Dec 21 19:03:27 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Jan 1 07:14:52 2022 +0100 osl::Mutex->std::mutex in SwXFrame Change-Id: I3d809accf34bf89f638481c84a671826ca4bd45f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127816 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index da51bdc3455f..73f713b438aa 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -97,7 +97,7 @@ #include <frmatr.hxx> #include <ndtxt.hxx> #include <ndgrf.hxx> -#include <osl/mutex.hxx> +#include <mutex> #include <vcl/svapp.hxx> #include <vcl/GraphicLoader.hxx> #include <SwStyleNameMapper.hxx> @@ -109,7 +109,7 @@ #include <fmtfollowtextflow.hxx> #include <fmtwrapinfluenceonobjpos.hxx> #include <toolkit/helper/vclunohelper.hxx> -#include <comphelper/interfacecontainer3.hxx> +#include <comphelper/interfacecontainer4.hxx> #include <comphelper/servicehelper.hxx> #include <cppuhelper/supportsservice.hxx> #include <sal/log.hxx> @@ -1151,14 +1151,10 @@ bool SwOLEProperties_Impl::AnyToItemSet( class SwXFrame::Impl { -private: - ::osl::Mutex m_Mutex; // just for OInterfaceContainerHelper3 - public: uno::WeakReference<uno::XInterface> m_wThis; - ::comphelper::OInterfaceContainerHelper3<css::lang::XEventListener> m_EventListeners; - - Impl() : m_EventListeners(m_Mutex) { } + std::mutex m_Mutex; // just for OInterfaceContainerHelper4 + ::comphelper::OInterfaceContainerHelper4<css::lang::XEventListener> m_EventListeners; }; const ::uno::Sequence< sal_Int8 > & SwXFrame::getUnoTunnelId() @@ -2623,8 +2619,11 @@ void SwXFrame::DisposeInternal() { // fdo#72695: if UNO object is already dead, don't revive it with event return; } - lang::EventObject const ev(xThis); - m_pImpl->m_EventListeners.disposeAndClear(ev); + { + lang::EventObject const ev(xThis); + std::unique_lock aGuard(m_pImpl->m_Mutex); + m_pImpl->m_EventListeners.disposeAndClear(aGuard, ev); + } m_pFrameFormat = nullptr; EndListeningAll(); } commit 35c92336c5e1e81f87597350975296172bc36258 Author: Noel Grandin <noelgran...@gmail.com> AuthorDate: Tue Dec 21 17:25:53 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Jan 1 07:14:38 2022 +0100 osl::Mutex->std::mutex in SwThreadJoiner Change-Id: Id0fb961e78c7db9e352babce12625ac355d99d51 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127810 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/sw/source/core/docnode/swthreadjoiner.cxx b/sw/source/core/docnode/swthreadjoiner.cxx index d506bb7f115b..6ff198d7dda3 100644 --- a/sw/source/core/docnode/swthreadjoiner.cxx +++ b/sw/source/core/docnode/swthreadjoiner.cxx @@ -20,7 +20,7 @@ #include <swthreadjoiner.hxx> #include <com/sun/star/util/JobManager.hpp> #include <comphelper/processfactory.hxx> -#include <osl/mutex.hxx> +#include <mutex> // Testing @@ -33,8 +33,8 @@ uno::Reference<util::XJobManager> pThreadJoiner; uno::Reference<util::XJobManager>& SwThreadJoiner::GetThreadJoiner() { - static osl::Mutex theJoinerMutex; - osl::MutexGuard aGuard(theJoinerMutex); + static std::mutex theJoinerMutex; + std::unique_lock aGuard(theJoinerMutex); if (!pThreadJoiner.is()) {