X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=Control%2FConcurrent.hs;fp=Control%2FConcurrent.hs;h=a25e65941ce5bd341c2fe3e89bbeee0363c128a7;hb=1c9b35dcdfbec4c68c65f770bb13e71617e919f9;hp=ce668fb4b4e213e9ba43c7ceea59cfbc690ecc88;hpb=5a888827c14dcbf279c986531cf8a6e8ee19eef1;p=ghc-base.git diff --git a/Control/Concurrent.hs b/Control/Concurrent.hs index ce668fb..a25e659 100644 --- a/Control/Concurrent.hs +++ b/Control/Concurrent.hs @@ -482,7 +482,7 @@ foreign import ccall unsafe "rtsSupportsBoundThreads" threaded :: Bool withThread :: IO a -> IO a withThread io = do m <- newEmptyMVar - _ <- forkIO $ try io >>= putMVar m + _ <- block $ forkIO $ try io >>= putMVar m x <- takeMVar m case x of Right a -> return a