[Libreoffice-commits] core.git: comphelper/source include/comphelper
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Jul 29 18:32:19 UTC 2021
comphelper/source/streaming/oslfile2streamwrap.cxx | 8 ++++----
include/comphelper/oslfile2streamwrap.hxx | 6 +++---
2 files changed, 7 insertions(+), 7 deletions(-)
New commits:
commit f186149acd5018c66b9d11c8e3f30dda51b8e895
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jul 29 16:04:42 2021 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Jul 29 20:31:44 2021 +0200
osl::Mutex->std::mutex in OSLInputStreamWrapper
Change-Id: Id67cf7989a47f73b62e48b88c3e6f51efc2ccc46
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119674
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/comphelper/source/streaming/oslfile2streamwrap.cxx b/comphelper/source/streaming/oslfile2streamwrap.cxx
index eff916a833ff..472e085d642e 100644
--- a/comphelper/source/streaming/oslfile2streamwrap.cxx
+++ b/comphelper/source/streaming/oslfile2streamwrap.cxx
@@ -51,10 +51,10 @@ sal_Int32 SAL_CALL OSLInputStreamWrapper::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 );
-
aData.realloc(nBytesToRead);
+ std::lock_guard aGuard( m_aMutex );
+
sal_uInt64 nRead = 0;
FileBase::RC eError = m_pFile->read(static_cast<void*>(aData.getArray()), nBytesToRead, nRead);
if (eError != FileBase::E_None)
@@ -80,7 +80,7 @@ sal_Int32 SAL_CALL OSLInputStreamWrapper::readSomeBytes(css::uno::Sequence< sal_
void SAL_CALL OSLInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip)
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::lock_guard aGuard( m_aMutex );
if (!m_pFile)
throw css::io::NotConnectedException(OUString(), static_cast<css::uno::XWeak*>(this));
@@ -97,7 +97,7 @@ void SAL_CALL OSLInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip)
sal_Int32 SAL_CALL OSLInputStreamWrapper::available()
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ std::lock_guard aGuard( m_aMutex );
if (!m_pFile)
throw css::io::NotConnectedException(OUString(), static_cast<css::uno::XWeak*>(this));
diff --git a/include/comphelper/oslfile2streamwrap.hxx b/include/comphelper/oslfile2streamwrap.hxx
index a7393b411ac7..c80c7b3447dc 100644
--- a/include/comphelper/oslfile2streamwrap.hxx
+++ b/include/comphelper/oslfile2streamwrap.hxx
@@ -19,11 +19,11 @@
#ifndef INCLUDED_COMPHELPER_OSLFILE2STREAMWRAP_HXX
#define INCLUDED_COMPHELPER_OSLFILE2STREAMWRAP_HXX
-#include <osl/mutex.hxx>
#include <com/sun/star/io/XOutputStream.hpp>
- #include <com/sun/star/io/XInputStream.hpp>
+#include <com/sun/star/io/XInputStream.hpp>
#include <cppuhelper/implbase.hxx>
#include <comphelper/comphelperdllapi.h>
+#include <mutex>
namespace osl { class File; }
@@ -47,7 +47,7 @@ private:
virtual sal_Int32 SAL_CALL available() override;
virtual void SAL_CALL closeInput() override;
- ::osl::Mutex m_aMutex;
+ std::mutex m_aMutex;
::osl::File* m_pFile;
};
More information about the Libreoffice-commits
mailing list