projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7e84448
)
Make the non-threaded-RTS threadDelay wait at least as long as asked
author
Ian Lynagh
<igloo@earth.li>
Tue, 28 Nov 2006 21:05:16 +0000
(21:05 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Tue, 28 Nov 2006 21:05:16 +0000
(21:05 +0000)
rts/PrimOps.cmm
patch
|
blob
|
history
diff --git
a/rts/PrimOps.cmm
b/rts/PrimOps.cmm
index
3252993
..
bfb0b86
100644
(file)
--- a/
rts/PrimOps.cmm
+++ b/
rts/PrimOps.cmm
@@
-2052,8
+2052,11
@@
delayzh_fast
#else
W_ time;
#else
W_ time;
+ W_ divisor;
time = foreign "C" getourtimeofday() [R1];
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. */
StgTSO_block_info(CurrentTSO) = target;
/* Insert the new thread in the sleeping queue. */