diff options
author | Rüdiger Timm <rt@openoffice.org> | 2003-04-23 15:58:20 +0000 |
---|---|---|
committer | Rüdiger Timm <rt@openoffice.org> | 2003-04-23 15:58:20 +0000 |
commit | da132b90d8a79a1958d2cfcf3face8950ab17a38 (patch) | |
tree | 74b07a958da7a73a0343b343afa0abfe0edec5cb /basic/source | |
parent | dedd063d3429bc8756e00bd0da800fb4dd80f1e7 (diff) |
INTEGRATION: CWS uno2 (1.12.38); FILE MERGED
2003/04/11 12:14:55 ab 1.12.38.1: #108152# Use Timer and yield in RTL function Wait
Diffstat (limited to 'basic/source')
-rw-r--r-- | basic/source/runtime/methods1.cxx | 46 |
1 files changed, 10 insertions, 36 deletions
diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index ded5162e56c9..388265197356 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -2,9 +2,9 @@ * * $RCSfile: methods1.cxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: ab $ $Date: 2002-12-12 16:48:03 $ + * last change: $Author: rt $ $Date: 2003-04-23 16:58:20 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -77,6 +77,9 @@ #ifndef _SV_WRKWIN_HXX #include <vcl/wrkwin.hxx> #endif +#ifndef _SV_TIMER_HXX +#include <vcl/timer.hxx> +#endif #ifndef _SBXVAR_HXX #include <svtools/sbxvar.hxx> #endif @@ -430,41 +433,12 @@ RTLFUNC(Wait) StarBASIC::Error( SbERR_BAD_ARGUMENT ); return; } -#if defined(OS2) - ULONG nStart, nCur; - DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT,&nStart,sizeof(ULONG) ); - // drucken wir gerade? - int bPrinting = Sysdepen::IsMultiThread() ? TRUE : FALSE; - do - { - Application::Reschedule(); - if( bPrinting ) - DosSleep( 50 ); // damit der Druck-Thread mehr CPU-Zeit bekommt - DosQuerySysInfo( QSV_MS_COUNT, QSV_MS_COUNT,&nCur,sizeof(ULONG) ); - } while( (nCur-nStart) < (ULONG)nWait ); -#else - long nSeconds = nWait / 1000; - if( !nSeconds ) nSeconds = 1; -#if defined(UNX) || defined(WIN) - // Unix hat kein clock() - time_t nStart = time( 0 ); - time_t nEnd; - do - { - Application::Reschedule(); - nEnd = time( 0 ); - } while( (nEnd-nStart) < nSeconds ); -#else - clock_t nStart = clock() / CLK_TCK; - clock_t nEnd; - do - { - Application::Reschedule(); - nEnd = clock() / CLK_TCK; - } while( (nEnd-nStart) < nSeconds ); -#endif -#endif + Timer aTimer; + aTimer.SetTimeout( nWait ); + aTimer.Start(); + while ( aTimer.IsActive() ) + Application::Yield(); } RTLFUNC(GetGUIVersion) |