summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatúš Kukan <matus.kukan@collabora.com>2014-09-25 11:39:11 +0200
committerMatúš Kukan <matus.kukan@collabora.com>2014-10-23 11:53:15 +0200
commit8cc5b621aa308de2272bed32bc8cd88626455831 (patch)
tree182b18c166a10b5aff9a9ffeeeeb0b68c229ec83
parentc8b3ed2ec3bec708df678d54fd68a1a78c6f7c8a (diff)
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
-rw-r--r--comphelper/source/streaming/seqstream.cxx9
-rw-r--r--include/comphelper/seqstream.hxx1
2 files changed, 1 insertions, 9 deletions
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;
}
diff --git a/include/comphelper/seqstream.hxx b/include/comphelper/seqstream.hxx
index d4f301cdd1d8..13dd4dc42550 100644
--- a/include/comphelper/seqstream.hxx
+++ b/include/comphelper/seqstream.hxx
@@ -89,7 +89,6 @@ protected:
sal_Int32 m_nSize;
bool m_bConnected; ///< closeOutput has been called ?
- ::osl::Mutex m_aMutex;
public:
/** constructs the object. Everything written into the stream through the XOutputStream methods will be forwarded