From: simonmar Date: Thu, 25 Jan 2001 13:30:31 +0000 (+0000) Subject: [project @ 2001-01-25 13:30:31 by simonmar] X-Git-Tag: Approximately_9120_patches~2831 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=81882e8a99310e695fb5cf6f5e7761bc0ea81a4d;p=ghc-hetmet.git [project @ 2001-01-25 13:30:31 by simonmar] Use gettimeofday() to set the target for threadDelay. The previous timestamp + ticks hack was wrong, because the virtual timer ticks in CPU time rather than wall-clock time. --- diff --git a/ghc/rts/PrimOps.hc b/ghc/rts/PrimOps.hc index 27629ce..efb83c5 100644 --- a/ghc/rts/PrimOps.hc +++ b/ghc/rts/PrimOps.hc @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: PrimOps.hc,v 1.68 2001/01/16 11:57:06 simonmar Exp $ + * $Id: PrimOps.hc,v 1.69 2001/01/25 13:30:31 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -1107,7 +1107,7 @@ FN_(delayzh_fast) ACQUIRE_LOCK(&sched_mutex); - target = (R1.i / (TICK_MILLISECS*1000)) + timestamp + ticks_since_timestamp; + target = (R1.i / (TICK_MILLISECS*1000)) + getourtimeofday(); CurrentTSO->block_info.target = target; /* Insert the new thread in the sleeping queue. */