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 /io | |
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 'io')
-rw-r--r-- | io/test/stm/pumptest.cxx | 5 | ||||
-rw-r--r-- | io/test/testconnection.cxx | 6 |
2 files changed, 4 insertions, 7 deletions
diff --git a/io/test/stm/pumptest.cxx b/io/test/stm/pumptest.cxx index 8077760a351f..d337bc21a81a 100644 --- a/io/test/stm/pumptest.cxx +++ b/io/test/stm/pumptest.cxx @@ -35,7 +35,7 @@ #include <uno/mapping.hxx> #include <cppuhelper/implbase.hxx> #include <cppuhelper/factory.hxx> -#include <osl/thread.h> +#include <osl/thread.hxx> #include <list> @@ -50,8 +50,7 @@ using namespace ::com::sun::star::test; static void mywait() { - TimeValue a = { 0, 10000 }; - osl_waitThread( &a ); + osl::Thread::wait(std::chrono::microseconds(10)); osl_yieldThread(); osl_yieldThread(); } diff --git a/io/test/testconnection.cxx b/io/test/testconnection.cxx index 69a2bdeccfb8..68621643f0ec 100644 --- a/io/test/testconnection.cxx +++ b/io/test/testconnection.cxx @@ -127,8 +127,7 @@ void testConnection( const OUString &sConnectionDescription , try { // Why is this wait necessary ???? - TimeValue value = {1,0}; - osl_waitThread( &value ); + osl::Thread::wait(std::chrono::seconds(1)); r = rConnector->connect( sConnectionDescription ); OSL_ASSERT( r.is() ); doWrite( r ); @@ -238,8 +237,7 @@ int SAL_CALL main( int argc, char * argv[] ) MyThread thread( rAcceptor , OUString("socket,host=localhost,port=2001") ); thread.create(); - TimeValue value = {0,1}; - osl_waitThread( &value ); + osl::Thread::wait(std::chrono::nanoseconds(1)); try { rAcceptor->accept( OUString("socket,host=localhost,port=2001") ); |