diff options
author | Kevin Dubrulle <kevin.dubrulle@gmail.com> | 2018-07-07 13:34:20 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-07-08 11:48:40 +0200 |
commit | d0f44d8ba7e87aa263008d3cfc4e68294d783162 (patch) | |
tree | 8527c62fb066366df2b40386c6544e670aa10a1a /testtools | |
parent | a2193f8f33565cc896592acb9d3ab65c756d97fb (diff) |
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 <noel.grandin@collabora.co.uk>
Diffstat (limited to 'testtools')
-rw-r--r-- | testtools/source/bridgetest/cppobj.cxx | 7 | ||||
-rw-r--r-- | testtools/source/performance/ubtest.cxx | 6 |
2 files changed, 4 insertions, 9 deletions
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 <cppu/unotype.hxx> #include <osl/diagnose.h> #include <osl/diagnose.hxx> -#include <osl/thread.h> +#include <osl/thread.hxx> #include <osl/mutex.hxx> #include <osl/time.h> @@ -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 <osl/mutex.hxx> #include <osl/module.h> #include <osl/process.h> -#include <osl/thread.h> +#include <osl/thread.hxx> #include <osl/conditn.hxx> #include <osl/time.h> @@ -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") ) ); |