summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--canvas/source/directx/dx_9rm.cxx7
-rw-r--r--io/test/stm/pumptest.cxx5
-rw-r--r--io/test/testconnection.cxx6
-rw-r--r--package/source/zipapi/ZipOutputStream.cxx3
-rw-r--r--sal/qa/osl/mutex/osl_Mutex.cxx5
-rw-r--r--sal/qa/osl/pipe/osl_Pipe.cxx5
-rw-r--r--sal/qa/osl/process/osl_Thread.cxx9
-rw-r--r--sal/qa/rtl/doublelock/rtl_doublelocking.cxx10
-rw-r--r--sw/source/core/docnode/finalthreadmanager.cxx10
-rw-r--r--testtools/source/bridgetest/cppobj.cxx7
-rw-r--r--testtools/source/performance/ubtest.cxx6
-rw-r--r--vcl/unx/generic/dtrans/X11_selection.cxx11
-rw-r--r--vcl/workben/vcldemo.cxx19
13 files changed, 27 insertions, 76 deletions
diff --git a/canvas/source/directx/dx_9rm.cxx b/canvas/source/directx/dx_9rm.cxx
index 3cc7fd5437a3..55165bbcedcc 100644
--- a/canvas/source/directx/dx_9rm.cxx
+++ b/canvas/source/directx/dx_9rm.cxx
@@ -27,7 +27,7 @@
#include <basegfx/vector/b2dsize.hxx>
#include <basegfx/vector/b2isize.hxx>
#include <com/sun/star/lang/NoSupportException.hpp>
-#include <osl/thread.h>
+#include <osl/thread.hxx>
#include <osl/time.h>
#include <tools/diagnose_ex.h>
#include <vcl/syschild.hxx>
@@ -880,10 +880,7 @@ namespace dxcanvas
return true;
}
- TimeValue aTimeout;
- aTimeout.Seconds=1;
- aTimeout.Nanosec=0;
- osl_waitThread(&aTimeout);
+ osl::Thread::wait(std::chrono::seconds(1));
}
while(hr == D3DERR_DEVICELOST);
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") );
diff --git a/package/source/zipapi/ZipOutputStream.cxx b/package/source/zipapi/ZipOutputStream.cxx
index 94f8d024dd7c..c15fdaee48ef 100644
--- a/package/source/zipapi/ZipOutputStream.cxx
+++ b/package/source/zipapi/ZipOutputStream.cxx
@@ -154,8 +154,7 @@ void ZipOutputStream::reduceScheduledThreadsToGivenNumberOrLess(sal_Int32 nThrea
if(static_cast< sal_Int32 >(m_aEntries.size()) > nThreads)
{
- const TimeValue aTimeValue(0, 100000);
- osl_waitThread(&aTimeValue);
+ osl::Thread::wait(std::chrono::microseconds(100));
}
}
}
diff --git a/sal/qa/osl/mutex/osl_Mutex.cxx b/sal/qa/osl/mutex/osl_Mutex.cxx
index 90f5b31e2c79..c9959038c5ea 100644
--- a/sal/qa/osl/mutex/osl_Mutex.cxx
+++ b/sal/qa/osl/mutex/osl_Mutex.cxx
@@ -34,10 +34,7 @@ namespace ThreadHelper
{
void thread_sleep_tenth_sec(sal_uInt32 _nTenthSec)
{
- TimeValue nTV;
- nTV.Seconds = _nTenthSec/10;
- nTV.Nanosec = ( (_nTenthSec%10 ) * 100000000 );
- osl_waitThread(&nTV);
+ osl::Thread::wait(std::chrono::milliseconds(_nTenthSec * 100));
}
void thread_sleep( sal_uInt32 _nSec )
{
diff --git a/sal/qa/osl/pipe/osl_Pipe.cxx b/sal/qa/osl/pipe/osl_Pipe.cxx
index ea29fdd7c742..dbd224e50da5 100644
--- a/sal/qa/osl/pipe/osl_Pipe.cxx
+++ b/sal/qa/osl/pipe/osl_Pipe.cxx
@@ -743,10 +743,7 @@ namespace osl_StreamPipe
/// print statement in thread process must use fflush() to force display.
fflush(stdout);
- TimeValue nTV;
- nTV.Seconds = _nSec;
- nTV.Nanosec = 0;
- osl_waitThread(&nTV);
+ osl::Thread::wait(std::chrono::seconds(_nSec));
}
// test read/write & send/recv data to pipe
diff --git a/sal/qa/osl/process/osl_Thread.cxx b/sal/qa/osl/process/osl_Thread.cxx
index 396aa86efdb4..e5c9680cf35b 100644
--- a/sal/qa/osl/process/osl_Thread.cxx
+++ b/sal/qa/osl/process/osl_Thread.cxx
@@ -180,14 +180,7 @@ namespace ThreadHelper
{
void thread_sleep_tenth_sec(sal_Int32 _nTenthSec)
{
-#ifdef _WIN32
- Sleep(_nTenthSec * 100 );
-#else
- TimeValue nTV;
- nTV.Seconds = static_cast<sal_uInt32>( _nTenthSec/10 );
- nTV.Nanosec = ( (_nTenthSec%10 ) * 100000000 );
- osl_waitThread(&nTV);
-#endif
+ osl::Thread::wait(std::chrono::milliseconds(_nTenthSec * 100));
}
void outputPriority(oslThreadPriority const& _aPriority)
diff --git a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
index f882b104c9bc..e37400ba7f8f 100644
--- a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
+++ b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx
@@ -67,15 +67,7 @@ namespace ThreadHelper
// printf("wait %d tenth seconds. ", _nTenthSec );
// fflush(stdout);
// }
-#ifdef _WIN32 //Windows
- Sleep(_nTenthSec * 100 );
-#endif
-#if ( defined UNX )
- TimeValue nTV;
- nTV.Seconds = static_cast<sal_uInt32>( _nTenthSec/10 );
- nTV.Nanosec = ( (_nTenthSec%10 ) * 100000000 );
- osl_waitThread(&nTV);
-#endif
+ osl::Thread::wait(std::chrono::milliseconds(_nTenthSec * 100));
// if (nVerbose == VERBOSE)
// {
// printf("done\n");
diff --git a/sw/source/core/docnode/finalthreadmanager.cxx b/sw/source/core/docnode/finalthreadmanager.cxx
index 5791979045bb..f0c88197c758 100644
--- a/sw/source/core/docnode/finalthreadmanager.cxx
+++ b/sw/source/core/docnode/finalthreadmanager.cxx
@@ -133,10 +133,7 @@ void SAL_CALL CancelJobsThread::run()
mbAllJobsCancelled = true;
{
- TimeValue aSleepTime;
- aSleepTime.Seconds = 1;
- aSleepTime.Nanosec = 0;
- osl_waitThread( &aSleepTime );
+ osl::Thread::wait(std::chrono::seconds(1));
}
}
}
@@ -357,10 +354,7 @@ void SAL_CALL FinalThreadManager::queryTermination( const css::lang::EventObject
if ( mpCancelJobsThread != nullptr &&
!mpCancelJobsThread->allJobsCancelled() )
{
- TimeValue aSleepTime;
- aSleepTime.Seconds = 1;
- aSleepTime.Nanosec = 0;
- osl_waitThread( &aSleepTime );
+ osl::Thread::wait(std::chrono::seconds(1));
}
if ( mpCancelJobsThread != nullptr &&
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") ) );
diff --git a/vcl/unx/generic/dtrans/X11_selection.cxx b/vcl/unx/generic/dtrans/X11_selection.cxx
index 7096c0c59c8d..43f0d228002c 100644
--- a/vcl/unx/generic/dtrans/X11_selection.cxx
+++ b/vcl/unx/generic/dtrans/X11_selection.cxx
@@ -943,11 +943,7 @@ bool SelectionManager::getPasteData( Atom selection, Atom type, Sequence< sal_In
}
else
{
- TimeValue aTVal;
- aTVal.Seconds = 0;
- aTVal.Nanosec = 100000000;
- aGuard.clear();
- osl_waitThread( &aTVal );
+ osl::Thread::wait(std::chrono::milliseconds(100));
aGuard.reset();
}
if( bHandle )
@@ -3369,15 +3365,12 @@ void SelectionManager::dragDoDispatch()
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "begin executeDrag dispatching\n" );
#endif
- TimeValue aTVal;
- aTVal.Seconds = 0;
- aTVal.Nanosec = 200000000;
oslThread aThread = m_aDragExecuteThread;
while( m_xDragSourceListener.is() && ( ! m_bDropSent || time(nullptr)-m_nDropTimeout < 5 ) && osl_scheduleThread( aThread ) )
{
// let the thread in the run method do the dispatching
// just look occasionally here whether drop timed out or is completed
- osl_waitThread( &aTVal );
+ osl::Thread::wait(std::chrono::milliseconds(200));
}
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "end executeDrag dispatching\n" );
diff --git a/vcl/workben/vcldemo.cxx b/vcl/workben/vcldemo.cxx
index 0df08ad41176..4cac3e072ab7 100644
--- a/vcl/workben/vcldemo.cxx
+++ b/vcl/workben/vcldemo.cxx
@@ -1716,14 +1716,13 @@ class DemoWin : public WorkWindow
class RenderThread : public salhelper::Thread {
DemoWin &mrWin;
- TimeValue maDelay;
+ sal_uInt32 mnDelaySecs = 0;
public:
RenderThread(DemoWin &rWin, sal_uInt32 nDelaySecs)
: Thread("vcldemo render thread")
, mrWin(rWin)
+ , mnDelaySecs(nDelaySecs)
{
- maDelay.Seconds = nDelaySecs;
- maDelay.Nanosec = 0;
launch();
}
virtual ~RenderThread() override
@@ -1732,7 +1731,7 @@ class DemoWin : public WorkWindow
}
virtual void execute() override
{
- osl_waitThread(&maDelay);
+ wait(std::chrono::seconds(mnDelaySecs));
SolarMutexGuard aGuard;
fprintf (stderr, "render from a different thread\n");
@@ -1933,20 +1932,18 @@ public:
IMPL_LINK_NOARG(DemoWidgets, GLTestClick, Button*, void)
{
sal_Int32 nSelected = mpGLCombo->GetSelectedEntryPos();
+ sal_uInt32 nDelaySeconds = 0;
- TimeValue aDelay;
- aDelay.Seconds = 0;
- aDelay.Nanosec = 0;
switch (nSelected)
{
case 0:
- aDelay.Seconds = 1;
+ nDelaySeconds = 1;
break;
case 1:
- aDelay.Seconds = 3;
+ nDelaySeconds = 3;
break;
case 2:
- aDelay.Seconds = 7;
+ nDelaySeconds = 7;
break;
default:
break;
@@ -1956,7 +1953,7 @@ IMPL_LINK_NOARG(DemoWidgets, GLTestClick, Button*, void)
if (bEnterLeave)
OpenGLZoneTest::enter();
- osl_waitThread(&aDelay);
+ osl::Thread::wait(std::chrono::seconds(nDelaySeconds));
if (bEnterLeave)
OpenGLZoneTest::leave();