2008-10-07 18:42 UTC+0200 Viktor Szakats (harbour.01 syenar hu)

* source/rtl/seconds.c
    * Some cleanup after latest change.
      Functionality shouldn't change. OS/2 users pls verify.
This commit is contained in:
Viktor Szakats
2008-10-07 16:44:37 +00:00
parent a867f6a312
commit d98434208b
2 changed files with 41 additions and 42 deletions

View File

@@ -8,6 +8,11 @@
2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org)
*/
2008-10-07 18:42 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* source/rtl/seconds.c
* Some cleanup after latest change.
Functionality shouldn't change. OS/2 users pls verify.
2008-10-07 18:36 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/estack.c
! fixed typo in last commit
@@ -23,23 +28,23 @@
some random CPU delay used to resolve the conflict.
2008-10-07 16:33 UTC+0200 Maurilio Longo (maurilio.longo@libero.it)
* harbour/source/rtl/seconds.c
+ Added OS/2 section to secondsCPU(), but it does not work as expected :)
In particular, user and system times are kept per thread, but when a thread
dies the time it has spent in user and system-land gets lost, so the
overall running time of the program decreases. Not only, if I call
secondsCPU() before a thread starts and after it has ended I'll have
no idea of the time that was spent by that thread.
* harbour/source/rtl/seconds.c
+ Added OS/2 section to secondsCPU(), but it does not work as expected :)
In particular, user and system times are kept per thread, but when a thread
dies the time it has spent in user and system-land gets lost, so the
overall running time of the program decreases. Not only, if I call
secondsCPU() before a thread starts and after it has ended I'll have
no idea of the time that was spent by that thread.
2008-10-07 14:24 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbapierr.h
* source/vm/extrap.c
* source/rtl/errorint.c
! Fixed recent modification on Windows platform, where
GPF would generate an internal error.
It didn't launch the OS error handler.
! Fixed hb_errInternal() being marked as HB_EXPORT
in the headers only.
* include/hbapierr.h
* source/vm/extrap.c
* source/rtl/errorint.c
! Fixed recent modification on Windows platform, where
GPF would generate an internal error.
It didn't launch the OS error handler.
! Fixed hb_errInternal() being marked as HB_EXPORT
in the headers only.
2008-10-07 09:33 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbextern.ch

View File

@@ -257,14 +257,9 @@ HB_EXPORT double hb_secondsCPU( int n )
#endif
#if defined( HB_OS_OS2 )
static ULONG timer_interval = 0;
static ULONG s_timer_interval = 0;
APIRET rc;
QSGREC ** pBuf;
QSGREC * pGrec;
QSPREC * pPrec;
QSTREC * pTrec;
int i;
#endif
if( ( n < 1 || n > 3 ) && ( n < 11 || n > 13 ) )
@@ -313,48 +308,47 @@ HB_EXPORT double hb_secondsCPU( int n )
d /= 10000000.0;
}
else
#elif defined( HB_OS_OS2 )
if ( timer_interval == 0 ) {
DosQuerySysInfo( QSV_TIMER_INTERVAL, QSV_TIMER_INTERVAL, (PVOID) &timer_interval, sizeof( ULONG ) );
}
if( s_timer_interval == 0 )
DosQuerySysInfo( QSV_TIMER_INTERVAL, QSV_TIMER_INTERVAL, ( PVOID ) &s_timer_interval, sizeof( ULONG ) );
pBuf = malloc( BUFSIZE );
QSGREC ** pBuf = hb_xalloc( BUFSIZE );
if ( pBuf ) {
if( pBuff )
{
APIRET rc = DosQuerySysState( QS_PROCESS, 0L, _getpid(), 0L, pBuf, BUFSIZE );
rc = DosQuerySysState( QS_PROCESS, 0L, _getpid(), 0L, pBuf, BUFSIZE );
if( rc == NO_ERROR )
{
QSGREC * pGrec = * pBuf;
QSPREC * pPrec = ( ULONG ) pGrec + sizeof( QSGREC );
QSTREC * pTrec = pPrec->pThrdRec;
if ( rc == NO_ERROR ) {
pGrec = * pBuf;
pPrec = (ULONG) pGrec + sizeof( QSGREC );
pTrec = pPrec->pThrdRec;
for ( i = 0; i < pPrec->cTCB; i++, pTrec++ ) {
int i;
for( i = 0; i < pPrec->cTCB; i++, pTrec++ )
{
if( n & 1 )
d += pTrec->usertime;
if( n & 2 )
d += pTrec->systime;
}
d = d * 10.0 / timer_interval;
d = d * 10.0 / s_timer_interval;
}
free( pBuf );
} else
hb_xfree( pBuf );
}
else
#endif
{
/* TODO: this code is only for DOS and other platforms which cannot
calculate process time */
printf( "non qui!\r\n");
if( n & 1 )
d = hb_dateSeconds( );
d = hb_dateSeconds();
}
#endif
return d;