[Libreoffice-commits] core.git: xmlhelp/source

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Sat Jul 31 20:33:07 UTC 2021


 xmlhelp/source/cxxhelp/provider/urlparameter.cxx |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

New commits:
commit 26f7e6320942890ff0b916d37cde02270475ae16
Author:     Noel Grandin <noelgrandin at gmail.com>
AuthorDate: Sat Jul 31 19:07:49 2021 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Sat Jul 31 22:32:34 2021 +0200

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

diff --git a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
index e06a8df419ce..75633b3d03ae 100644
--- a/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
+++ b/xmlhelp/source/cxxhelp/provider/urlparameter.cxx
@@ -42,6 +42,7 @@
 #include "databases.hxx"
 
 #include <memory>
+#include <mutex>
 
 using namespace cppu;
 using namespace com::sun::star::io;
@@ -319,7 +320,7 @@ public:
 
 private:
 
-    osl::Mutex m_aMutex;
+    std::mutex m_aMutex;
 
     int pos;
     OStringBuffer buffer;
@@ -902,7 +903,7 @@ void SAL_CALL InputStreamTransformer::release() noexcept
 
 sal_Int32 SAL_CALL InputStreamTransformer::readBytes( Sequence< sal_Int8 >& aData,sal_Int32 nBytesToRead )
 {
-    osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
 
     int curr,available_ = buffer.getLength() - pos;
     if( nBytesToRead <= available_ )
@@ -928,14 +929,14 @@ sal_Int32 SAL_CALL InputStreamTransformer::readSomeBytes( Sequence< sal_Int8 >&
 
 void SAL_CALL InputStreamTransformer::skipBytes( sal_Int32 nBytesToSkip )
 {
-    osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
     while( nBytesToSkip-- ) ++pos;
 }
 
 
 sal_Int32 SAL_CALL InputStreamTransformer::available()
 {
-    osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
     return std::min<sal_Int64>(SAL_MAX_INT32, buffer.getLength() - pos);
 }
 
@@ -947,7 +948,7 @@ void SAL_CALL InputStreamTransformer::closeInput()
 
 void SAL_CALL InputStreamTransformer::seek( sal_Int64 location )
 {
-    osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
     if( location < 0 )
         throw IllegalArgumentException();
 
@@ -960,14 +961,14 @@ void SAL_CALL InputStreamTransformer::seek( sal_Int64 location )
 
 sal_Int64 SAL_CALL InputStreamTransformer::getPosition()
 {
-    osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
     return sal_Int64( pos );
 }
 
 
 sal_Int64 SAL_CALL InputStreamTransformer::getLength()
 {
-    osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
 
     return buffer.getLength();
 }
@@ -975,7 +976,7 @@ sal_Int64 SAL_CALL InputStreamTransformer::getLength()
 
 void InputStreamTransformer::addToBuffer( const char* buffer_,int len_ )
 {
-    osl::MutexGuard aGuard( m_aMutex );
+    std::lock_guard aGuard( m_aMutex );
 
     buffer.append( buffer_, len_ );
 }


More information about the Libreoffice-commits mailing list