include/unotools/streamhelper.hxx | 4 ++-- unotools/source/streaming/streamhelper.cxx | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-)
New commits: commit 429e6e6efbfbc65d36452cbf8b3a25740a1dc8bc Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Fri Jul 30 15:08:23 2021 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Sat Jul 31 11:16:41 2021 +0200 osl::Mutex->std::mutex in OInputStreamHelper Change-Id: Ia6aa6541474e0e4c190ab805a931d74c8a598baf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119723 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/unotools/streamhelper.hxx b/include/unotools/streamhelper.hxx index 05c5a5b45e84..26c7aa37c2da 100644 --- a/include/unotools/streamhelper.hxx +++ b/include/unotools/streamhelper.hxx @@ -23,9 +23,9 @@ #include <unotools/unotoolsdllapi.h> #include <com/sun/star/io/XInputStream.hpp> #include <com/sun/star/io/XSeekable.hpp> -#include <osl/mutex.hxx> #include <cppuhelper/implbase.hxx> #include <tools/stream.hxx> +#include <mutex> namespace utl { @@ -35,7 +35,7 @@ namespace utl */ class UNOTOOLS_DLLPUBLIC OInputStreamHelper final : public cppu::WeakImplHelper<css::io::XInputStream, css::io::XSeekable> { - ::osl::Mutex m_aMutex; + std::mutex m_aMutex; SvLockBytesRef m_xLockBytes; sal_uInt64 m_nActPos; sal_Int32 m_nAvailable; // this is typically the chunk(buffer) size diff --git a/unotools/source/streaming/streamhelper.cxx b/unotools/source/streaming/streamhelper.cxx index cf5930d43f19..bd8824d9456f 100644 --- a/unotools/source/streaming/streamhelper.cxx +++ b/unotools/source/streaming/streamhelper.cxx @@ -36,7 +36,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readBytes(css::uno::Sequence< sal_Int8 >& if (nBytesToRead < 0) throw css::io::BufferSizeExceededException(OUString(), static_cast<css::uno::XWeak*>(this)); - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); if (aData.getLength() < nBytesToRead) aData.realloc(nBytesToRead); @@ -56,7 +56,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readBytes(css::uno::Sequence< sal_Int8 >& void SAL_CALL OInputStreamHelper::seek( sal_Int64 location ) { - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); m_nActPos = location; } @@ -70,7 +70,7 @@ sal_Int64 SAL_CALL OInputStreamHelper::getLength( ) if (!m_xLockBytes.is()) return 0; - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); SvLockBytesStat aStat; m_xLockBytes->Stat( &aStat ); return aStat.nSize; @@ -85,7 +85,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::readSomeBytes(css::uno::Sequence< sal_Int void SAL_CALL OInputStreamHelper::skipBytes(sal_Int32 nBytesToSkip) { - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); if (!m_xLockBytes.is()) throw css::io::NotConnectedException(OUString(), static_cast<css::uno::XWeak*>(this)); @@ -97,7 +97,7 @@ void SAL_CALL OInputStreamHelper::skipBytes(sal_Int32 nBytesToSkip) sal_Int32 SAL_CALL OInputStreamHelper::available() { - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); if (!m_xLockBytes.is()) throw css::io::NotConnectedException(OUString(), static_cast<css::uno::XWeak*>(this)); @@ -106,7 +106,7 @@ sal_Int32 SAL_CALL OInputStreamHelper::available() void SAL_CALL OInputStreamHelper::closeInput() { - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); if (!m_xLockBytes.is()) throw css::io::NotConnectedException(OUString(), static_cast<css::uno::XWeak*>(this));