diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-05-08 12:54:05 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-08 20:49:22 +0200 |
commit | 0daeb60f4fd24a0b075b94775a9d635fe7fc0824 (patch) | |
tree | f3f287284e27c990ee9426445e473daaa6ea9e36 /io | |
parent | fd4a089df684a38cff18e77217961ee4bee0c497 (diff) |
osl::Mutex->std::mutex in OMarkableOutputStream
Change-Id: Ie39f8cd7f8de8dfe647d006d0fd0c62fddc72a8c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134018
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'io')
-rw-r--r-- | io/source/stm/omark.cxx | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/io/source/stm/omark.cxx b/io/source/stm/omark.cxx index 411f6412c830..60ec1f9d2f28 100644 --- a/io/source/stm/omark.cxx +++ b/io/source/stm/omark.cxx @@ -39,7 +39,7 @@ #include <osl/mutex.hxx> #include <osl/diagnose.h> - +#include <mutex> using namespace ::std; using namespace ::cppu; @@ -121,7 +121,7 @@ private: sal_Int32 m_nCurrentPos; sal_Int32 m_nCurrentMark; - Mutex m_mutex; + std::mutex m_mutex; }; } @@ -145,7 +145,7 @@ void OMarkableOutputStream::writeBytes(const Sequence< sal_Int8 >& aData) m_output->writeBytes( aData ); } else { - MutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); // new data must be buffered m_pBuffer->writeAt( m_nCurrentPos , aData ); m_nCurrentPos += aData.getLength(); @@ -158,7 +158,7 @@ void OMarkableOutputStream::flush() { Reference< XOutputStream > output; { - MutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); output = m_output; } @@ -176,7 +176,7 @@ void OMarkableOutputStream::closeOutput() if( !m_bValidStream ) { throw NotConnectedException(); } - MutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); // all marks must be cleared and all m_mapMarks.clear(); @@ -194,7 +194,7 @@ void OMarkableOutputStream::closeOutput() sal_Int32 OMarkableOutputStream::createMark() { - MutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); sal_Int32 nMark = m_nCurrentMark; m_mapMarks[nMark] = m_nCurrentPos; @@ -205,7 +205,7 @@ sal_Int32 OMarkableOutputStream::createMark() void OMarkableOutputStream::deleteMark(sal_Int32 Mark) { - MutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); map<sal_Int32,sal_Int32,less<sal_Int32> >::iterator ii = m_mapMarks.find( Mark ); if( ii == m_mapMarks.end() ) { @@ -219,7 +219,7 @@ void OMarkableOutputStream::deleteMark(sal_Int32 Mark) void OMarkableOutputStream::jumpToMark(sal_Int32 nMark) { - MutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); map<sal_Int32,sal_Int32,less<sal_Int32> >::iterator ii = m_mapMarks.find( nMark ); if( ii == m_mapMarks.end() ) { @@ -232,7 +232,7 @@ void OMarkableOutputStream::jumpToMark(sal_Int32 nMark) void OMarkableOutputStream::jumpToFurthest() { - MutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); m_nCurrentPos = m_pBuffer->getSize(); checkMarksAndFlush(); } @@ -240,7 +240,7 @@ void OMarkableOutputStream::jumpToFurthest() sal_Int32 OMarkableOutputStream::offsetToMark(sal_Int32 nMark) { - MutexGuard guard( m_mutex ); + std::unique_lock guard( m_mutex ); map<sal_Int32,sal_Int32,less<sal_Int32> >::const_iterator ii = m_mapMarks.find( nMark ); if( ii == m_mapMarks.end() ) |