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

Andrzej Hunt (via logerrit) logerrit at kemper.freedesktop.org
Fri Jul 16 05:21:10 UTC 2021


 sd/source/ui/remotecontrol/Transmitter.cxx |   14 +++++++-------
 sd/source/ui/remotecontrol/Transmitter.hxx |    2 +-
 2 files changed, 8 insertions(+), 8 deletions(-)

New commits:
commit f4ea1e6095ff751cbecf10061c4eff9934ffd520
Author:     Andrzej Hunt <andrzej at ahunt.org>
AuthorDate: Sun Jul 11 17:22:54 2021 +0200
Commit:     Andrzej Hunt <andrzej at ahunt.org>
CommitDate: Fri Jul 16 07:20:36 2021 +0200

    sdremote: Transmitter: s/mQueuesNotEmpty/mProcessingRequired/
    
    Make mProcessingRequired's name a bit more self-explanatory to make it
    clear what we're actually using it for. See also a 8e6cdb0 which
    fixed a race condition caused by incorrect use of this Condition.
    
    Change-Id: I6ad63dbd5ae8ed767f42ea22e568ac47a4d08642
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118752
    Tested-by: Jenkins
    Reviewed-by: Andrzej Hunt <andrzej at ahunt.org>

diff --git a/sd/source/ui/remotecontrol/Transmitter.cxx b/sd/source/ui/remotecontrol/Transmitter.cxx
index 76cda8feae55..f00f15502a45 100644
--- a/sd/source/ui/remotecontrol/Transmitter.cxx
+++ b/sd/source/ui/remotecontrol/Transmitter.cxx
@@ -16,7 +16,7 @@ using namespace sd;
 
 Transmitter::Transmitter( IBluetoothSocket* aSocket )
   : pStreamSocket( aSocket ),
-    mQueuesNotEmpty(),
+    mProcessingRequired(),
     mMutex(),
     mFinishRequested( false ),
     mLowPriority(),
@@ -30,7 +30,7 @@ void SAL_CALL Transmitter::run()
 
     while ( true )
     {
-        mQueuesNotEmpty.wait();
+        mProcessingRequired.wait();
 
         ::osl::MutexGuard aGuard( mMutex );
 
@@ -52,9 +52,9 @@ void SAL_CALL Transmitter::run()
             pStreamSocket->write( aMessage.getStr(), aMessage.getLength() );
         }
 
-        if ( mLowPriority.empty() && mHighPriority.empty() )
+        if ( mLowPriority.empty() && mHighPriority.empty())
         {
-            mQueuesNotEmpty.reset();
+            mProcessingRequired.reset();
         }
     }
 }
@@ -63,7 +63,7 @@ void Transmitter::notifyFinished()
 {
     ::osl::MutexGuard aGuard( mMutex );
     mFinishRequested = true;
-    mQueuesNotEmpty.set();
+    mProcessingRequired.set();
 }
 
 Transmitter::~Transmitter()
@@ -82,9 +82,9 @@ void Transmitter::addMessage( const OString& aMessage, const Priority aPriority
             mHighPriority.push( aMessage );
             break;
     }
-    if ( !mQueuesNotEmpty.check() )
+    if ( !mProcessingRequired.check() )
     {
-        mQueuesNotEmpty.set();
+        mProcessingRequired.set();
     }
 }
 
diff --git a/sd/source/ui/remotecontrol/Transmitter.hxx b/sd/source/ui/remotecontrol/Transmitter.hxx
index 1cd94ea26712..c24f5a5a46fe 100644
--- a/sd/source/ui/remotecontrol/Transmitter.hxx
+++ b/sd/source/ui/remotecontrol/Transmitter.hxx
@@ -36,7 +36,7 @@ private:
 
     ::sd::IBluetoothSocket* pStreamSocket;
 
-    ::osl::Condition mQueuesNotEmpty;
+    ::osl::Condition mProcessingRequired;
 
     ::osl::Mutex mMutex;
     /**


More information about the Libreoffice-commits mailing list