Skip to content

Commit

Permalink
Incredibly important ONE CHARACTER fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
rrnewton committed Mar 28, 2013
1 parent 2a6c656 commit 0618d60
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion haskell-prototype/BFS.hs
Expand Up @@ -134,7 +134,8 @@ verbose :: Bool
verbose = checkEnv "VERBOSE" False verbose = checkEnv "VERBOSE" False


dbg :: Bool dbg :: Bool
dbg = checkEnv "DEBUG" False -- dbg = checkEnv "DEBUG" False
dbg = False -- Let it inline, DCE.


main :: IO () main :: IO ()
main = do main = do
Expand Down
6 changes: 3 additions & 3 deletions haskell-prototype/LVarTracePure.hs
Expand Up @@ -295,11 +295,11 @@ sched queue t = loop t
-- potentially more expensive than in the plain IVar case.) -- potentially more expensive than in the plain IVar case.)
-- e <- readIORef ref -- e <- readIORef ref
let thisCB x = let thisCB x =
trace ("... LVar blocked, thresh attempted "++show(hashStableName$ unsafePerformIO$ makeStableName x)) -- trace ("... LVar blocked, thresh attempted "++show(hashStableName$ unsafePerformIO$ makeStableName x))
fmap cont $ thresh x fmap cont $ thresh x
r <- atomicModifyIORef ref $ \ st@(LVarContents a ls) -> r <- atomicModifyIORef ref $ \ st@(LVarContents a ls) ->
case thresh a of case thresh a of
Just b -> trace ("... LVar get, thresh passed ") Just b -> -- trace ("... LVar get, thresh passed ")
(st, loop (cont b)) (st, loop (cont b))
Nothing -> (LVarContents a (thisCB:ls), reschedule queue) Nothing -> (LVarContents a (thisCB:ls), reschedule queue)
r r
Expand All @@ -322,7 +322,7 @@ sched queue t = loop t
(ls',woken) = loop ls [] [] (ls',woken) = loop ls [] []
loop [] f w = (f,w) loop [] f w = (f,w)
loop (hd:tl) f w = loop (hd:tl) f w =
case hd new of case hd new' of

This comment has been minimized.

Copy link
@lkuper

lkuper Mar 28, 2013

Member

Holy cow.

Just trc -> loop tl f (trc:w) Just trc -> loop tl f (trc:w)
Nothing -> loop tl (hd:f) w Nothing -> loop tl (hd:f) w
-- Callbacks invoked: -- Callbacks invoked:
Expand Down

0 comments on commit 0618d60

Please sign in to comment.