From 8cc5b621aa308de2272bed32bc8cd88626455831 Mon Sep 17 00:00:00 2001 From: Matúš Kukan Date: Thu, 25 Sep 2014 11:39:11 +0200 Subject: Remove mutex from OSequenceOutputStream; it's intended to be fast Make the caller responsible for using it wisely. AFAICS it's used only in FastSaxSerializer, so far. Change-Id: I50d48fd7f3e6cdeb9e4637868da213b8171e542b --- comphelper/source/streaming/seqstream.cxx | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) (limited to 'comphelper') diff --git a/comphelper/source/streaming/seqstream.cxx b/comphelper/source/streaming/seqstream.cxx index 5bc44a52e877..d66ce3bde083 100644 --- a/comphelper/source/streaming/seqstream.cxx +++ b/comphelper/source/streaming/seqstream.cxx @@ -159,7 +159,6 @@ OSequenceOutputStream::OSequenceOutputStream(Sequence< sal_Int8 >& _rSeq, double void SAL_CALL OSequenceOutputStream::writeBytes( const Sequence< sal_Int8 >& _rData ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException, std::exception) { - MutexGuard aGuard(m_aMutex); if (!m_bConnected) throw NotConnectedException(); @@ -210,7 +209,6 @@ void SAL_CALL OSequenceOutputStream::writeBytes( const Sequence< sal_Int8 >& _rD void SAL_CALL OSequenceOutputStream::flush( ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException, std::exception) { - MutexGuard aGuard(m_aMutex); if (!m_bConnected) throw NotConnectedException(); @@ -221,12 +219,7 @@ void SAL_CALL OSequenceOutputStream::flush( ) throw(NotConnectedException, Buff void SAL_CALL OSequenceOutputStream::closeOutput( ) throw(NotConnectedException, BufferSizeExceededException, IOException, RuntimeException, std::exception) { - MutexGuard aGuard(m_aMutex); - if (!m_bConnected) - throw NotConnectedException(); - - // cut the sequence to the real size - m_rSequence.realloc(m_nSize); + flush(); // and don't allow any further accesses m_bConnected = false; } -- cgit