From 81882e8a99310e695fb5cf6f5e7761bc0ea81a4d Mon Sep 17 00:00:00 2001 From: simonmar Date: Thu, 25 Jan 2001 13:30:31 +0000 Subject: [PATCH] [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. --- ghc/rts/PrimOps.hc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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. */ -- 1.7.10.4