diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-03 11:36:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-08-03 12:20:53 +0200 |
commit | 05ab38359ae72f2a54dc0b5f1b84ac5f649c507a (patch) | |
tree | 5830c7ee2442984e0bc804def7bd95ddd8a25410 /xmlhelp | |
parent | 5afdcad4c0e7850b18996c549892b9360cd8973f (diff) |
Consolidate on C++17 std::scoped_lock instead of std::lock_guard
as in commit 9376f65a26240441bf9dd6ae1f69886dc9fa60fa
Change-Id: I3ad9afd4d113582a214a4a4bc7eea55e38cd6ff9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119927
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/cxxhelp/provider/urlparameter.cxx | 14 | ||||
-rw-r--r-- | xmlhelp/source/treeview/tvread.cxx | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx index 75633b3d03ae..0474bc5738fa 100644 --- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx +++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx @@ -903,7 +903,7 @@ void SAL_CALL InputStreamTransformer::release() noexcept sal_Int32 SAL_CALL InputStreamTransformer::readBytes( Sequence< sal_Int8 >& aData,sal_Int32 nBytesToRead ) { - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); int curr,available_ = buffer.getLength() - pos; if( nBytesToRead <= available_ ) @@ -929,14 +929,14 @@ sal_Int32 SAL_CALL InputStreamTransformer::readSomeBytes( Sequence< sal_Int8 >& void SAL_CALL InputStreamTransformer::skipBytes( sal_Int32 nBytesToSkip ) { - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); while( nBytesToSkip-- ) ++pos; } sal_Int32 SAL_CALL InputStreamTransformer::available() { - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); return std::min<sal_Int64>(SAL_MAX_INT32, buffer.getLength() - pos); } @@ -948,7 +948,7 @@ void SAL_CALL InputStreamTransformer::closeInput() void SAL_CALL InputStreamTransformer::seek( sal_Int64 location ) { - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); if( location < 0 ) throw IllegalArgumentException(); @@ -961,14 +961,14 @@ void SAL_CALL InputStreamTransformer::seek( sal_Int64 location ) sal_Int64 SAL_CALL InputStreamTransformer::getPosition() { - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); return sal_Int64( pos ); } sal_Int64 SAL_CALL InputStreamTransformer::getLength() { - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); return buffer.getLength(); } @@ -976,7 +976,7 @@ sal_Int64 SAL_CALL InputStreamTransformer::getLength() void InputStreamTransformer::addToBuffer( const char* buffer_,int len_ ) { - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); buffer.append( buffer_, len_ ); } diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index c374b4242585..852101bb52ad 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -1081,7 +1081,7 @@ OUString TreeFileIterator::expandURL( const OUString& aURL ) static Reference< util::XMacroExpander > xMacroExpander; static Reference< uri::XUriReferenceFactory > xFac; - std::lock_guard aGuard( m_aMutex ); + std::scoped_lock aGuard( m_aMutex ); if( !xMacroExpander.is() || !xFac.is() ) { |