include/ucbhelper/fd_inputstream.hxx         |    8 +++-----
 ucbhelper/source/provider/fd_inputstream.cxx |   10 +++++-----
 2 files changed, 8 insertions(+), 10 deletions(-)

New commits:
commit b4a5e6f025973b5a4ba8210168569fc1a5a34254
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Mon Feb 20 15:49:41 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Mon Feb 20 17:45:49 2023 +0000

    osl::Mutex->std::mutex in ucbhelper::FdInputStream
    
    Change-Id: I10482c3a5f9848f45463837d5d8982476b3910a7
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147340
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/include/ucbhelper/fd_inputstream.hxx 
b/include/ucbhelper/fd_inputstream.hxx
index ebef7dae7869..5035ecd906dd 100644
--- a/include/ucbhelper/fd_inputstream.hxx
+++ b/include/ucbhelper/fd_inputstream.hxx
@@ -24,9 +24,8 @@
 #include <com/sun/star/io/XInputStream.hpp>
 #include <com/sun/star/io/XSeekable.hpp>
 #include <cppuhelper/implbase.hxx>
-#include <cppuhelper/basemutex.hxx>
-
 #include <ucbhelper/ucbhelperdllapi.h>
+#include <mutex>
 
 namespace ucbhelper
 {
@@ -37,9 +36,7 @@ namespace ucbhelper
     /** Implements a seekable InputStream
      *  working on a buffer.
      */
-    class UCBHELPER_DLLPUBLIC FdInputStream final
-        : protected cppu::BaseMutex,
-          public FdInputStream_Base
+    class UCBHELPER_DLLPUBLIC FdInputStream final : public FdInputStream_Base
     {
     public:
 
@@ -83,6 +80,7 @@ namespace ucbhelper
         getLength() override;
 
     private:
+        std::mutex m_aMutex;
         oslFileHandle m_tmpfl;
         sal_uInt64 m_nLength;
     };
diff --git a/ucbhelper/source/provider/fd_inputstream.cxx 
b/ucbhelper/source/provider/fd_inputstream.cxx
index 795c2dcaea7c..05f3357b7157 100644
--- a/ucbhelper/source/provider/fd_inputstream.cxx
+++ b/ucbhelper/source/provider/fd_inputstream.cxx
@@ -57,7 +57,7 @@ namespace ucbhelper
     sal_Int32 SAL_CALL FdInputStream::readBytes(Sequence< sal_Int8 >& aData,
                                                  sal_Int32 nBytesToRead)
     {
-        osl::MutexGuard aGuard(m_aMutex);
+        std::unique_lock aGuard(m_aMutex);
 
         sal_uInt64 nBeforePos( 0 );
         sal_uInt64 nBytesRequested( nBytesToRead );
@@ -87,7 +87,7 @@ namespace ucbhelper
 
     void SAL_CALL FdInputStream::skipBytes(sal_Int32 nBytesToSkip)
     {
-        osl::MutexGuard aGuard(m_aMutex);
+        std::unique_lock aGuard(m_aMutex);
         if(!m_tmpfl)
             throw IOException();
 
@@ -104,7 +104,7 @@ namespace ucbhelper
 
     void SAL_CALL FdInputStream::closeInput()
     {
-        osl::MutexGuard aGuard(m_aMutex);
+        std::unique_lock aGuard(m_aMutex);
         if(m_tmpfl)
         {
             osl_closeFile(m_tmpfl);
@@ -115,7 +115,7 @@ namespace ucbhelper
 
     void SAL_CALL FdInputStream::seek(sal_Int64 location)
     {
-        osl::MutexGuard aGuard(m_aMutex);
+        std::unique_lock aGuard(m_aMutex);
         if(!m_tmpfl)
             throw IOException();
 
@@ -127,7 +127,7 @@ namespace ucbhelper
     sal_Int64 SAL_CALL
     FdInputStream::getPosition()
     {
-        osl::MutexGuard aGuard(m_aMutex);
+        std::unique_lock aGuard(m_aMutex);
         if(!m_tmpfl)
             throw IOException();
 

Reply via email to