summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-30 09:48:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-30 11:33:17 +0200
commitbb2470ffb749ed95e77cc112ee08a46c8b99be36 (patch)
tree79a21861ec1d2d1269a583e359d196edd990966a
parent957a66e58444a2ac4bb77d978fd08e84fceffc38 (diff)
osl::Mutex->std::mutx in OSequenceOutputStream
Change-Id: I1924cc0910c5dfb431b676a0f50f922779920594 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119697 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--comphelper/source/streaming/seqstream.cxx8
-rw-r--r--include/comphelper/seqstream.hxx5
2 files changed, 5 insertions, 8 deletions
diff --git a/comphelper/source/streaming/seqstream.cxx b/comphelper/source/streaming/seqstream.cxx
index b33c63f0931b..9ad5db7254b8 100644
--- a/comphelper/source/streaming/seqstream.cxx
+++ b/comphelper/source/streaming/seqstream.cxx
@@ -153,7 +153,7 @@ OSequenceOutputStream::OSequenceOutputStream(Sequence< sal_Int8 >& _rSeq, double
void SAL_CALL OSequenceOutputStream::writeBytes( const Sequence< sal_Int8 >& _rData )
{
- MutexGuard aGuard(m_aMutex);
+ std::lock_guard aGuard(m_aMutex);
if (!m_bConnected)
throw NotConnectedException();
@@ -193,7 +193,7 @@ void SAL_CALL OSequenceOutputStream::writeBytes( const Sequence< sal_Int8 >& _rD
void SAL_CALL OSequenceOutputStream::flush( )
{
- MutexGuard aGuard(m_aMutex);
+ std::lock_guard aGuard(m_aMutex);
if (!m_bConnected)
throw NotConnectedException();
@@ -203,8 +203,6 @@ void SAL_CALL OSequenceOutputStream::flush( )
void OSequenceOutputStream::finalizeOutput()
{
- MutexGuard aGuard(m_aMutex);
-
// cut the sequence to the real size
m_rSequence.realloc(m_nSize);
// and don't allow any further accesses
@@ -213,7 +211,7 @@ void OSequenceOutputStream::finalizeOutput()
void SAL_CALL OSequenceOutputStream::closeOutput()
{
- MutexGuard aGuard(m_aMutex);
+ std::lock_guard aGuard(m_aMutex);
if (!m_bConnected)
throw NotConnectedException();
diff --git a/include/comphelper/seqstream.hxx b/include/comphelper/seqstream.hxx
index 88db729832c5..6cf22fdb6ebb 100644
--- a/include/comphelper/seqstream.hxx
+++ b/include/comphelper/seqstream.hxx
@@ -24,7 +24,6 @@
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XSeekable.hpp>
-#include <osl/mutex.hxx>
#include <cppuhelper/implbase.hxx>
#include <comphelper/comphelperdllapi.h>
#include <mutex>
@@ -74,7 +73,6 @@ class SAL_DLLPUBLIC_TEMPLATE OSequenceOutputStream_Base
class UNLESS_MERGELIBS(COMPHELPER_DLLPUBLIC) OSequenceOutputStream final : public OSequenceOutputStream_Base
{
private:
- void finalizeOutput();
css::uno::Sequence< sal_Int8 >& m_rSequence;
double m_nResizeFactor;
sal_Int32 const m_nMinimumResize;
@@ -85,8 +83,9 @@ private:
bool m_bConnected;
// closeOutput has been called ?
- ::osl::Mutex m_aMutex;
+ std::mutex m_aMutex;
+ void finalizeOutput();
virtual ~OSequenceOutputStream() override { if (m_bConnected) finalizeOutput(); }
public: