From d0f44d8ba7e87aa263008d3cfc4e68294d783162 Mon Sep 17 00:00:00 2001 From: Kevin Dubrulle Date: Sat, 7 Jul 2018 13:34:20 +0200 Subject: tdf#84323 - sal - add sane sleep interface: cleanup osl_waitThread Replace osl_waitThread by osl::Thread::wait. Use std::chrono instead of TimeValue. Change-Id: I71691d014feeeb0c5d0ba29d048bda8e25e6e7dd Reviewed-on: https://gerrit.libreoffice.org/57130 Tested-by: Jenkins Reviewed-by: Noel Grandin --- testtools/source/bridgetest/cppobj.cxx | 7 ++----- testtools/source/performance/ubtest.cxx | 6 ++---- 2 files changed, 4 insertions(+), 9 deletions(-) (limited to 'testtools') diff --git a/testtools/source/bridgetest/cppobj.cxx b/testtools/source/bridgetest/cppobj.cxx index 6280a13f8158..b9137f7a9559 100644 --- a/testtools/source/bridgetest/cppobj.cxx +++ b/testtools/source/bridgetest/cppobj.cxx @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include @@ -465,10 +465,7 @@ namespace { void wait(sal_Int32 microSeconds) { OSL_ASSERT(microSeconds >= 0 && microSeconds <= SAL_MAX_INT32 / 1000); - TimeValue t = { - static_cast< sal_uInt32 >(microSeconds / 1000000), - static_cast< sal_uInt32 >(microSeconds * 1000) }; - osl_waitThread(&t); + osl::Thread::wait(std::chrono::microseconds(microSeconds)); } } diff --git a/testtools/source/performance/ubtest.cxx b/testtools/source/performance/ubtest.cxx index 89643574198e..9b342d657d5a 100644 --- a/testtools/source/performance/ubtest.cxx +++ b/testtools/source/performance/ubtest.cxx @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include @@ -1103,9 +1103,7 @@ sal_Int32 TestImpl::run( const Sequence< OUString > & rArgs ) osl_freeProcessHandle( hProcess ); // wait three seconds - TimeValue threeSeconds; - threeSeconds.Seconds = 3; - osl_waitThread( &threeSeconds ); + osl::Thread::wait(std::chrono::seconds(3)); // connect and resolve outer process object Reference< XInterface > xResolvedObject( resolveObject( OUString("uno:socket,host=localhost,port=6000;iiop;TestRemoteObject") ) ); -- cgit