X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FPrimOps.cmm;h=bfb0b8607883ee809a9c83f44d00d5b697eccdf1;hb=80a766fdb6864eae613962e43ad9eb371e0ce80c;hp=3252993b1dbcf578c9cce268b29d9f5b81b87070;hpb=08560cf0e3a2a1928650ca5d5d0bb44fbac2ea44;p=ghc-hetmet.git diff --git a/rts/PrimOps.cmm b/rts/PrimOps.cmm index 3252993..bfb0b86 100644 --- a/rts/PrimOps.cmm +++ b/rts/PrimOps.cmm @@ -2052,8 +2052,11 @@ delayzh_fast #else W_ time; + W_ divisor; time = foreign "C" getourtimeofday() [R1]; - target = (R1 / (TO_W_(RtsFlags_MiscFlags_tickInterval(RtsFlags))*1000)) + time; + divisor = TO_W_(RtsFlags_MiscFlags_tickInterval(RtsFlags))*1000; + target = ((R1 + divisor - 1) / divisor) /* divide rounding up */ + + time + 1; /* Add 1 as getourtimeofday rounds down */ StgTSO_block_info(CurrentTSO) = target; /* Insert the new thread in the sleeping queue. */