Commit b5b8ae09 authored by simonmar's avatar simonmar
Browse files

[project @ 2005-03-31 08:59:34 by simonmar]

Make getourtimeofday() return lnat instead of nat, and propagate changes.
parent d63bd45e
......@@ -196,13 +196,12 @@ unblock_vtalrm_signal(void)
/* gettimeofday() takes around 1us on our 500MHz PIII. Since we're
* only calling it 50 times/s, it shouldn't have any great impact.
*/
nat
lnat
getourtimeofday(void)
{
struct timeval tv;
gettimeofday(&tv, (struct timezone *) NULL);
// cast to nat because nat may be 64 bit when int is only 32 bit
return ((nat)tv.tv_sec * TICK_FREQUENCY +
(nat)tv.tv_usec * TICK_FREQUENCY / 1000000);
// cast to lnat because nat may be 64 bit when int is only 32 bit
return ((lnat)tv.tv_sec * TICK_FREQUENCY +
(lnat)tv.tv_usec * TICK_FREQUENCY / 1000000);
}
......@@ -11,7 +11,7 @@
extern int startTicker( nat ms, TickProc handle_tick);
extern int stopTicker ( void );
extern nat getourtimeofday ( void );
extern lnat getourtimeofday ( void );
#if 0
/* unused */
extern void block_vtalrm_signal ( void );
......
......@@ -82,7 +82,7 @@ void awaitEvent(rtsBool wait); /* In Select.c */
* Called from STG : NO
* Locks assumed : sched_mutex
*/
rtsBool wakeUpSleepingThreads(nat); /* In Select.c */
rtsBool wakeUpSleepingThreads(lnat); /* In Select.c */
/* wakeBlockedWorkerThread()
*
......@@ -134,7 +134,7 @@ extern int RTS_VAR(context_switch);
extern rtsBool RTS_VAR(interrupted);
/* In Select.c */
extern nat RTS_VAR(timestamp);
extern lnat RTS_VAR(timestamp);
/* Thread queues.
* Locks required : sched_mutex
......
......@@ -35,7 +35,7 @@
#endif
/* last timestamp */
nat timestamp = 0;
lnat timestamp = 0;
/* There's a clever trick here to avoid problems when the time wraps
* around. Since our maximum delay is smaller than 31 bits of ticks
......@@ -49,7 +49,7 @@ nat timestamp = 0;
* (idea due to Andy Gill).
*/
rtsBool
wakeUpSleepingThreads(nat ticks)
wakeUpSleepingThreads(lnat ticks)
{
StgTSO *tso;
rtsBool flag = rtsFalse;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment