From e855dc52266eab9b43f5f2f679c84eb6e30be46e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 7 May 2022 08:55:07 +0200 Subject: [PATCH] osl::Mutex->std::mutex in TimeContainerEnumeration Change-Id: I44e054a6db59cbeae03b50cb0df4bcfdc8f293da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133969 Tested-by: Jenkins Reviewed-by: Noel Grandin --- animations/source/animcore/animcore.cxx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx index f72c15701b53..c02ba3ca2878 100644 --- a/animations/source/animcore/animcore.cxx +++ b/animations/source/animcore/animcore.cxx @@ -60,6 +60,7 @@ #include #include #include +#include namespace com::sun::star::uno { class XComponentContext; } namespace com::sun::star::beans { struct NamedValue; } @@ -366,8 +367,7 @@ private: }; -class TimeContainerEnumeration : private cppu::BaseMutex, - public ::cppu::WeakImplHelper< XEnumeration > +class TimeContainerEnumeration : public ::cppu::WeakImplHelper< XEnumeration > { public: explicit TimeContainerEnumeration( std::vector< Reference< XAnimationNode > >&& rChildren ); @@ -377,6 +377,8 @@ public: virtual Any SAL_CALL nextElement( ) override; private: + std::mutex m_aMutex; + /** sorted list of child nodes */ std::vector< Reference< XAnimationNode > > maChildren; @@ -395,14 +397,14 @@ TimeContainerEnumeration::TimeContainerEnumeration( std::vector< Reference< XAni // Methods sal_Bool SAL_CALL TimeContainerEnumeration::hasMoreElements() { - Guard< Mutex > aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); return maIter != maChildren.end(); } Any SAL_CALL TimeContainerEnumeration::nextElement() { - Guard< Mutex > aGuard( m_aMutex ); + std::unique_lock aGuard( m_aMutex ); if( maIter == maChildren.end() ) throw NoSuchElementException();