summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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: