[Libreoffice-commits] core.git: include/unotools unotools/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 31 09:17:38 UTC 2021


 include/unotools/streamwrap.hxx          |    4 ++--
 unotools/source/streaming/streamwrap.cxx |   14 +++++++-------
 2 files changed, 9 insertions(+), 9 deletions(-)

New commits:
commit dc0aebfb6a199761134d372f42401b81b37ca102
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Jul 30 15:10:17 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jul 31 11:17:02 2021 +0200

    osl::Mutex->std::mutex in OInputStreamWrapper
    
    Change-Id: I59dbb1d5d3aea9b94959d26e544eddfb600e9fa1
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/119724
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/include/unotools/streamwrap.hxx b/include/unotools/streamwrap.hxx
index 2e83c63bbdbf..4993ffd92f7c 100644
--- a/include/unotools/streamwrap.hxx
+++ b/include/unotools/streamwrap.hxx
@@ -21,7 +21,6 @@
 #define INCLUDED_UNOTOOLS_STREAMWRAP_HXX
 
 #include <unotools/unotoolsdllapi.h>
-#include <osl/mutex.hxx>
 #include <com/sun/star/io/XOutputStream.hpp>
 #include <com/sun/star/io/XInputStream.hpp>
 #include <com/sun/star/io/XSeekable.hpp>
@@ -30,6 +29,7 @@
 #include <cppuhelper/implbase.hxx>
 #include <cppuhelper/implbase1.hxx>
 #include <memory>
+#include <mutex>
 
 class SvStream;
 
@@ -43,7 +43,7 @@ class SAL_DLLPUBLIC_TEMPLATE OInputStreamWrapper_Base : public cppu::WeakImplHel
 class UNOTOOLS_DLLPUBLIC OInputStreamWrapper : public OInputStreamWrapper_Base
 {
 protected:
-    ::osl::Mutex    m_aMutex;
+    std::mutex      m_aMutex;
     SvStream*       m_pSvStream;
     bool        m_bSvStreamOwner : 1;
     OInputStreamWrapper()
diff --git a/unotools/source/streaming/streamwrap.cxx b/unotools/source/streaming/streamwrap.cxx
index 70054d0f58dc..77e7168d69a2 100644
--- a/unotools/source/streaming/streamwrap.cxx
+++ b/unotools/source/streaming/streamwrap.cxx
@@ -63,7 +63,7 @@ sal_Int32 SAL_CALL OInputStreamWrapper::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);
@@ -96,7 +96,7 @@ sal_Int32 SAL_CALL OInputStreamWrapper::readSomeBytes(css::uno::Sequence< sal_In
 
 void SAL_CALL OInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip)
 {
-    ::osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
     checkError();
 
     m_pSvStream->SeekRel(nBytesToSkip);
@@ -105,7 +105,7 @@ void SAL_CALL OInputStreamWrapper::skipBytes(sal_Int32 nBytesToSkip)
 
 sal_Int32 SAL_CALL OInputStreamWrapper::available()
 {
-    ::osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
     checkConnected();
 
     sal_Int64 nAvailable = m_pSvStream->remainingSize();
@@ -116,7 +116,7 @@ sal_Int32 SAL_CALL OInputStreamWrapper::available()
 
 void SAL_CALL OInputStreamWrapper::closeInput()
 {
-    ::osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
     checkConnected();
 
     if (m_bSvStreamOwner)
@@ -157,7 +157,7 @@ OSeekableInputStreamWrapper::OSeekableInputStreamWrapper(SvStream* _pStream, boo
 
 void SAL_CALL OSeekableInputStreamWrapper::seek( sal_Int64 _nLocation )
 {
-    ::osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
     checkConnected();
 
     m_pSvStream->Seek(static_cast<sal_uInt32>(_nLocation));
@@ -166,7 +166,7 @@ void SAL_CALL OSeekableInputStreamWrapper::seek( sal_Int64 _nLocation )
 
 sal_Int64 SAL_CALL OSeekableInputStreamWrapper::getPosition(  )
 {
-    ::osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
     checkConnected();
 
     sal_uInt32 nPos = m_pSvStream->Tell();
@@ -176,7 +176,7 @@ sal_Int64 SAL_CALL OSeekableInputStreamWrapper::getPosition(  )
 
 sal_Int64 SAL_CALL OSeekableInputStreamWrapper::getLength(  )
 {
-    ::osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
     checkConnected();
 
     checkError();


More information about the Libreoffice-commits mailing list