summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorArnaud Versini <arnaud.versini@libreoffice.org>2021-10-24 19:41:36 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-11-04 20:23:25 +0100
commitb439832fc36a05e4423f480f7a312428f2449cc6 (patch)
treeb5cb997d6d38b4a75648a38e7921ab66f5178b34 /include
parent4acc39564e7bf6051b851d533d67d1c31a4a19ea (diff)
comphelper : use std::mutex in enumhelper
Change-Id: I871c406e8ff94e646545cb82e0d1e2e2ec80c6e9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124125 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r--include/comphelper/enumhelper.hxx23
1 files changed, 10 insertions, 13 deletions
diff --git a/include/comphelper/enumhelper.hxx b/include/comphelper/enumhelper.hxx
index 5e5e000d78df..52f3aa743ade 100644
--- a/include/comphelper/enumhelper.hxx
+++ b/include/comphelper/enumhelper.hxx
@@ -23,7 +23,7 @@
#include <com/sun/star/container/XEnumeration.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <cppuhelper/implbase.hxx>
-#include <osl/mutex.hxx>
+#include <mutex>
#include <comphelper/comphelperdllapi.h>
namespace com::sun::star::container { class XIndexAccess; }
@@ -32,23 +32,18 @@ namespace com::sun::star::container { class XNameAccess; }
namespace comphelper
{
-struct OEnumerationLock
-{
- public:
- ::osl::Mutex m_aLock;
-};
-
/** provides a com.sun.star.container::XEnumeration access based
on an object implementing the com.sun.star.container::XNameAccess interface
*/
-class COMPHELPER_DLLPUBLIC OEnumerationByName final : private OEnumerationLock
- , public ::cppu::WeakImplHelper< css::container::XEnumeration ,
+class COMPHELPER_DLLPUBLIC OEnumerationByName final :
+ public ::cppu::WeakImplHelper< css::container::XEnumeration ,
css::lang::XEventListener >
{
css::uno::Sequence< OUString > const m_aNames;
css::uno::Reference< css::container::XNameAccess > m_xAccess;
sal_Int32 m_nPos;
bool m_bListening;
+ std::mutex m_aLock;
public:
OEnumerationByName(const css::uno::Reference< css::container::XNameAccess >& _rxAccess);
@@ -69,13 +64,14 @@ private:
/** provides a com.sun.star.container::XEnumeration access based
on an object implementing the com.sun.star.container::XNameAccess interface
*/
-class COMPHELPER_DLLPUBLIC OEnumerationByIndex final : private OEnumerationLock
- , public ::cppu::WeakImplHelper< css::container::XEnumeration ,
+class COMPHELPER_DLLPUBLIC OEnumerationByIndex final :
+ public ::cppu::WeakImplHelper< css::container::XEnumeration ,
css::lang::XEventListener >
{
css::uno::Reference< css::container::XIndexAccess > m_xAccess;
sal_Int32 m_nPos;
bool m_bListening;
+ std::mutex m_aLock;
public:
OEnumerationByIndex(const css::uno::Reference< css::container::XIndexAccess >& _rxAccess);
@@ -99,11 +95,12 @@ class SAL_DLLPUBLIC_TEMPLATE OAnyEnumeration_BASE
for an outside set vector of Any's.
*/
-class COMPHELPER_DLLPUBLIC OAnyEnumeration final : private OEnumerationLock
- , public OAnyEnumeration_BASE
+class COMPHELPER_DLLPUBLIC OAnyEnumeration final :
+ public OAnyEnumeration_BASE
{
sal_Int32 m_nPos;
css::uno::Sequence< css::uno::Any > m_lItems;
+ std::mutex m_aLock;
public:
OAnyEnumeration(const css::uno::Sequence< css::uno::Any >& lItems);