diff options
author | Simon Marlow <simonmar@microsoft.com> | 2007-09-03 13:25:23 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2007-09-03 13:25:23 +0000 |
commit | 8d71be7cbd079f5eab23484a53a43b59dd0399e5 (patch) | |
tree | 8772a7455fbba0e62f11b858dfecded04f68094e /rts/Ticker.h | |
parent | 37e27d92a0fc14105e4533514c3995fccd6da9fe (diff) | |
download | haskell-8d71be7cbd079f5eab23484a53a43b59dd0399e5.tar.gz |
FIX #1623: disable the timer signal when the system is idle (threaded RTS only)
Having a timer signal go off regularly is bad for power consumption,
and generally bad practice anyway (it means the app cannot be
completely swapped out, for example). Fortunately the threaded RTS
already had a way to detect when the system was idle, so that it can
trigger a GC and thereby find deadlocks. After performing the GC, we
now turn off timer signals, and re-enable them again just before
running any Haskell code.
Diffstat (limited to 'rts/Ticker.h')
-rw-r--r-- | rts/Ticker.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/rts/Ticker.h b/rts/Ticker.h index b06890a049..a39e7d69c1 100644 --- a/rts/Ticker.h +++ b/rts/Ticker.h @@ -2,14 +2,18 @@ * * (c) The GHC Team 2005 * - * Ticker interface (implementation is OS-specific) + * Interface to the OS-specific implementation of a regular time signal. * * ---------------------------------------------------------------------------*/ #ifndef TICKER_H #define TICKER_H -extern void startTicker( nat ms, TickProc handle_tick ); -extern void stopTicker ( void ); +typedef void (*TickProc)(int); + +extern void initTicker (nat ms, TickProc handle_tick); +extern void startTicker (void); +extern void stopTicker (void); +extern void exitTicker (void); #endif /* TICKER_H */ |