summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-07-29 16:04:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-07-29 20:31:44 +0200
commitf186149acd5018c66b9d11c8e3f30dda51b8e895 (patch)
treeac9a51f60fd22887cbc8a31c9e9bacb3fc6ae9bf
parentadeaa3a2cf31478c15147afe1303b77f8949293a (diff)
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@collabora.co.uk>
-rw-r--r--comphelper/source/streaming/oslfile2streamwrap.cxx8
-rw-r--r--include/comphelper/oslfile2streamwrap.hxx6
2 files changed, 7 insertions, 7 deletions
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;
};