diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2021-07-18 18:49:01 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2021-07-20 19:23:49 +0200 |
commit | a4a023f7f441d2d6281d06ec6293c583ebea4ab0 (patch) | |
tree | 561543d8eff466df97d8a08c9103dba3ba2f6919 /package | |
parent | 2ebde17fec5fa991bd211c56ca93b7e528eea5b8 (diff) |
osl::Mutex->std::mutex in ByteGrabber
Change-Id: I96ea49da6708041ac19e147f192c7e996d44b8ec
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119276
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'package')
-rw-r--r-- | package/inc/ByteGrabber.hxx | 4 | ||||
-rw-r--r-- | package/source/zipapi/ByteGrabber.cxx | 14 |
2 files changed, 9 insertions, 9 deletions
diff --git a/package/inc/ByteGrabber.hxx b/package/inc/ByteGrabber.hxx index 27d01deb1ca9..2ccacc1705f1 100644 --- a/package/inc/ByteGrabber.hxx +++ b/package/inc/ByteGrabber.hxx @@ -27,14 +27,14 @@ #include <com/sun/star/uno/RuntimeException.hpp> #include <com/sun/star/lang/IllegalArgumentException.hpp> -#include <osl/mutex.hxx> +#include <mutex> namespace com::sun::star { namespace io { class XSeekable; class XInputStream; } } class ByteGrabber final { - ::osl::Mutex m_aMutex; + std::mutex m_aMutex; css::uno::Reference < css::io::XInputStream > xStream; css::uno::Reference < css::io::XSeekable > xSeek; diff --git a/package/source/zipapi/ByteGrabber.cxx b/package/source/zipapi/ByteGrabber.cxx index 29195f849eb5..3b039e5000b1 100644 --- a/package/source/zipapi/ByteGrabber.cxx +++ b/package/source/zipapi/ByteGrabber.cxx @@ -48,7 +48,7 @@ ByteGrabber::~ByteGrabber() void ByteGrabber::setInputStream (const uno::Reference < io::XInputStream >& xNewStream) { - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); xStream = xNewStream; xSeek.set(xNewStream, uno::UNO_QUERY); } @@ -57,14 +57,14 @@ void ByteGrabber::setInputStream (const uno::Reference < io::XInputStream >& xNe sal_Int32 ByteGrabber::readBytes( uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) { - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); return xStream->readBytes(aData, nBytesToRead ); } // XSeekable chained... void ByteGrabber::seek( sal_Int64 location ) { - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); if (!xSeek.is() ) throw io::IOException(THROW_WHERE ); @@ -76,7 +76,7 @@ void ByteGrabber::seek( sal_Int64 location ) sal_Int64 ByteGrabber::getPosition( ) { - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); if (!xSeek.is() ) throw io::IOException(THROW_WHERE ); @@ -85,7 +85,7 @@ sal_Int64 ByteGrabber::getPosition( ) sal_Int64 ByteGrabber::getLength( ) { - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); if (!xSeek.is() ) throw io::IOException(THROW_WHERE ); @@ -94,7 +94,7 @@ sal_Int64 ByteGrabber::getLength( ) sal_uInt16 ByteGrabber::ReadUInt16() { - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); if (xStream->readBytes(aSequence, 2) != 2) return 0; @@ -107,7 +107,7 @@ sal_uInt16 ByteGrabber::ReadUInt16() sal_uInt32 ByteGrabber::ReadUInt32() { - ::osl::MutexGuard aGuard( m_aMutex ); + std::lock_guard aGuard( m_aMutex ); if (xStream->readBytes(aSequence, 4) != 4) return 0; |