X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FItimer.c;h=74801dba542ca6a45b0cf2cc7dc97c20ff2c4cf9;hb=91af47d422942336b6e9f93d1250e6385e252a95;hp=f1dd8237117ded1155af3e3acfdd7745b65095d0;hpb=557947d3f93e11285e36423ddb08d859af60ab47;p=ghc-hetmet.git diff --git a/ghc/rts/Itimer.c b/ghc/rts/Itimer.c index f1dd823..74801db 100644 --- a/ghc/rts/Itimer.c +++ b/ghc/rts/Itimer.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Itimer.c,v 1.32 2003/02/22 04:51:50 sof Exp $ + * $Id: Itimer.c,v 1.35 2003/03/29 00:27:11 sof Exp $ * * (c) The GHC Team, 1995-1999 * @@ -18,7 +18,6 @@ * to support. So much for standards. */ #include "Rts.h" -#if !defined(mingw32_TARGET_OS) /* to the end */ #include "RtsFlags.h" #include "Timer.h" #include "Itimer.h" @@ -43,7 +42,7 @@ static int -install_vtalrm_handler(void) +install_vtalrm_handler(TickProc handle_tick) { struct sigaction action; @@ -56,7 +55,7 @@ install_vtalrm_handler(void) } int -startTicker(nat ms) +startTicker(nat ms, TickProc handle_tick) { # ifndef HAVE_SETITIMER /* fprintf(stderr, "No virtual timer on this system\n"); */ @@ -64,7 +63,7 @@ startTicker(nat ms) # else struct itimerval it; - install_vtalrm_handler(); + install_vtalrm_handler(handle_tick); timestamp = getourtimeofday(); @@ -136,6 +135,8 @@ stopTicker() } # endif +#if 0 +/* Currently unused */ void block_vtalrm_signal(void) { @@ -157,6 +158,7 @@ unblock_vtalrm_signal(void) (void) sigprocmask(SIG_UNBLOCK, &signals, NULL); } +#endif /* gettimeofday() takes around 1us on our 500MHz PIII. Since we're * only calling it 50 times/s, it shouldn't have any great impact. @@ -170,4 +172,3 @@ getourtimeofday(void) tv.tv_usec * TICK_FREQUENCY / 1000000); } -#endif /* !mingw32_TARGET_OS */