[Libreoffice-commits] core.git: package/inc package/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Jul 20 17:24:32 UTC 2021


 package/inc/ByteGrabber.hxx           |    4 ++--
 package/source/zipapi/ByteGrabber.cxx |   14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit a4a023f7f441d2d6281d06ec6293c583ebea4ab0
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sun Jul 18 18:49:01 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Jul 20 19:23:49 2021 +0200

    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 at collabora.co.uk>

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;


More information about the Libreoffice-commits mailing list