From 26f7e6320942890ff0b916d37cde02270475ae16 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 31 Jul 2021 19:07:49 +0200 Subject: osl::Mutex->std::mutex in InputStreamTransformer Change-Id: I64344b890c35d35b3d1b481436eb624183febec6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119754 Tested-by: Jenkins Reviewed-by: Noel Grandin --- xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'xmlhelp') diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index e06a8df419ce..75633b3d03ae 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -42,6 +42,7 @@ #include "databases.hxx" #include +#include using namespace cppu; using namespace com::sun::star::io; @@ -319,7 +320,7 @@ public: private: - osl::Mutex m_aMutex; + std::mutex m_aMutex; int pos; OStringBuffer buffer; @@ -902,7 +903,7 @@ void SAL_CALL InputStreamTransformer::release() noexcept sal_Int32 SAL_CALL InputStreamTransformer::readBytes( Sequence< sal_Int8 >& aData,sal_Int32 nBytesToRead ) { - osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); int curr,available_ = buffer.getLength() - pos; if( nBytesToRead <= available_ ) @@ -928,14 +929,14 @@ sal_Int32 SAL_CALL InputStreamTransformer::readSomeBytes( Sequence< sal_Int8 >& void SAL_CALL InputStreamTransformer::skipBytes( sal_Int32 nBytesToSkip ) { - osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); while( nBytesToSkip-- ) ++pos; } sal_Int32 SAL_CALL InputStreamTransformer::available() { - osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); return std::min(SAL_MAX_INT32, buffer.getLength() - pos); } @@ -947,7 +948,7 @@ void SAL_CALL InputStreamTransformer::closeInput() void SAL_CALL InputStreamTransformer::seek( sal_Int64 location ) { - osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); if( location < 0 ) throw IllegalArgumentException(); @@ -960,14 +961,14 @@ void SAL_CALL InputStreamTransformer::seek( sal_Int64 location ) sal_Int64 SAL_CALL InputStreamTransformer::getPosition() { - osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); return sal_Int64( pos ); } sal_Int64 SAL_CALL InputStreamTransformer::getLength() { - osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); return buffer.getLength(); } @@ -975,7 +976,7 @@ sal_Int64 SAL_CALL InputStreamTransformer::getLength() void InputStreamTransformer::addToBuffer( const char* buffer_,int len_ ) { - osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); buffer.append( buffer_, len_ ); } -- cgit