[Libreoffice-commits] core.git: cppu/source smoketest/smoketest.cxx

Gurkaran gurkran at gmail.com
Tue Mar 22 06:57:52 UTC 2016


 cppu/source/threadpool/threadpool.cxx |    4 ++--
 smoketest/smoketest.cxx               |    4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

New commits:
commit d27e3eca2cca1249a0bdd9e6385ca693d471ef9b
Author: Gurkaran <gurkran at gmail.com>
Date:   Tue Mar 22 03:25:36 2016 +0530

    tdf#84323: Make osl::Condition::wait more readable
    
    It is to improve the readability of calls to osl::Condition::wait.
    
    Change-Id: I5945343c5a7e4729ab599380414d18280bd176fe
    Signed-off-by: Gurkaran <gurkran at gmail.com>
    Reviewed-on: https://gerrit.libreoffice.org/23417
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noelgrandin at gmail.com>

diff --git a/cppu/source/threadpool/threadpool.cxx b/cppu/source/threadpool/threadpool.cxx
index 9861d97..457ff94 100644
--- a/cppu/source/threadpool/threadpool.cxx
+++ b/cppu/source/threadpool/threadpool.cxx
@@ -20,6 +20,7 @@
 #include "sal/config.h"
 
 #include <cassert>
+#include <chrono>
 #include <algorithm>
 #include <unordered_map>
 
@@ -148,8 +149,7 @@ namespace cppu_threadpool
         }
 
         // let the thread wait 2 seconds
-        TimeValue time = { 2 , 0 };
-        waitingThread.condition.wait( &time );
+        waitingThread.condition.wait( std::chrono::seconds(2) );
 
         {
             MutexGuard guard ( m_mutexWaitingThreadList );
diff --git a/smoketest/smoketest.cxx b/smoketest/smoketest.cxx
index c4c2178..6bc2a9c 100644
--- a/smoketest/smoketest.cxx
+++ b/smoketest/smoketest.cxx
@@ -18,6 +18,7 @@
  */
 
 #include <sal/types.h>
+#include <chrono>
 #include "boost/noncopyable.hpp"
 #include "com/sun/star/awt/AsyncCallback.hpp"
 #include "com/sun/star/awt/XCallback.hpp"
@@ -177,8 +178,7 @@ void Test::test() {
             css::uno::Any());
     // Wait for result.condition or connection_ going stale:
     for (;;) {
-        TimeValue delay = { 1, 0 }; // 1 sec
-        osl::Condition::Result res = result.condition.wait(&delay);
+        osl::Condition::Result res = result.condition.wait(std::chrono::seconds(1)); // 1 sec delay
         if (res == osl::Condition::result_ok) {
             break;
         }


More information about the Libreoffice-commits mailing list