[Libreoffice-commits] core.git: include/unotools svl/source svtools/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jul 31 08:11:09 UTC 2021
include/unotools/itemholderbase.hxx | 6 ------
svl/source/config/itemholder2.cxx | 5 ++---
svl/source/config/itemholder2.hxx | 7 ++++---
svtools/source/config/itemholder2.cxx | 5 ++---
svtools/source/config/itemholder2.hxx | 6 +++---
5 files changed, 11 insertions(+), 18 deletions(-)
New commits:
commit d78d98e62255238d4ae6060b2a57ae37dbabb4e6
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 30 15:06:26 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jul 31 10:10:36 2021 +0200
osl::Mutex->std::mutex in ItemHolder2
Change-Id: I6e21d6b8b582d4793f64b04183edcfcb3b178f1a
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119722
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/unotools/itemholderbase.hxx b/include/unotools/itemholderbase.hxx
index 0445c8fc2498..9ce0131626df 100644
--- a/include/unotools/itemholderbase.hxx
+++ b/include/unotools/itemholderbase.hxx
@@ -21,14 +21,8 @@
#define INCLUDED_UNOTOOLS_ITEMHOLDERBASE_HXX
#include <memory>
-#include <osl/mutex.hxx>
#include <unotools/options.hxx>
-struct ItemHolderMutexBase
-{
- ::osl::Mutex m_aLock;
-};
-
enum class EItem
{
AccessibilityOptions , // 2
diff --git a/svl/source/config/itemholder2.cxx b/svl/source/config/itemholder2.cxx
index 6227ce390b45..4bcbe13c5c7c 100644
--- a/svl/source/config/itemholder2.cxx
+++ b/svl/source/config/itemholder2.cxx
@@ -31,7 +31,6 @@
#include <unotools/options.hxx>
ItemHolder2::ItemHolder2()
- : ItemHolderMutexBase()
{
try
{
@@ -76,7 +75,7 @@ void SAL_CALL ItemHolder2::disposing(const css::lang::EventObject&)
void ItemHolder2::impl_addItem(EItem eItem)
{
- osl::MutexGuard aLock(m_aLock);
+ std::lock_guard aLock(m_aLock);
for ( auto const & rInfo : m_lItems )
{
@@ -95,7 +94,7 @@ void ItemHolder2::impl_releaseAllItems()
{
std::vector< TItemInfo > items;
{
- ::osl::MutexGuard aLock(m_aLock);
+ std::lock_guard aLock(m_aLock);
items.swap(m_lItems);
}
diff --git a/svl/source/config/itemholder2.hxx b/svl/source/config/itemholder2.hxx
index 27d9f182ff03..cdb72581e715 100644
--- a/svl/source/config/itemholder2.hxx
+++ b/svl/source/config/itemholder2.hxx
@@ -23,13 +23,14 @@
#include <unotools/itemholderbase.hxx>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/lang/XEventListener.hpp>
+#include <mutex>
-class ItemHolder2 : private ItemHolderMutexBase
- , public ::cppu::WeakImplHelper< css::lang::XEventListener >
+class ItemHolder2 : public ::cppu::WeakImplHelper< css::lang::XEventListener >
{
// member
- private:
+private:
+ std::mutex m_aLock;
std::vector<TItemInfo> m_lItems;
// c++ interface
diff --git a/svtools/source/config/itemholder2.cxx b/svtools/source/config/itemholder2.cxx
index 92d3226b8e1c..396a90322a65 100644
--- a/svtools/source/config/itemholder2.cxx
+++ b/svtools/source/config/itemholder2.cxx
@@ -36,7 +36,6 @@
namespace svtools {
ItemHolder2::ItemHolder2()
- : ItemHolderMutexBase()
{
try
{
@@ -87,7 +86,7 @@ void SAL_CALL ItemHolder2::disposing(const css::lang::EventObject&)
void ItemHolder2::impl_addItem(EItem eItem)
{
- osl::MutexGuard aLock(m_aLock);
+ std::lock_guard aLock(m_aLock);
for ( auto const & rInfo : m_lItems )
{
@@ -107,7 +106,7 @@ void ItemHolder2::impl_releaseAllItems()
{
std::vector<TItemInfo> items;
{
- osl::MutexGuard aLock(m_aLock);
+ std::lock_guard aLock(m_aLock);
items.swap(m_lItems);
}
diff --git a/svtools/source/config/itemholder2.hxx b/svtools/source/config/itemholder2.hxx
index c4fd540cf2d3..3bb1a6871ba7 100644
--- a/svtools/source/config/itemholder2.hxx
+++ b/svtools/source/config/itemholder2.hxx
@@ -22,17 +22,17 @@
#include <unotools/itemholderbase.hxx>
#include <cppuhelper/implbase.hxx>
#include <com/sun/star/lang/XEventListener.hpp>
+#include <mutex>
namespace svtools {
-class ItemHolder2 : private ItemHolderMutexBase
- , public ::cppu::WeakImplHelper< css::lang::XEventListener >
+class ItemHolder2 : public ::cppu::WeakImplHelper< css::lang::XEventListener >
{
// member
private:
-
+ std::mutex m_aLock;
std::vector<TItemInfo> m_lItems;
More information about the Libreoffice-commits
mailing list