projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a88882
)
withThread: block asynchronous exceptions before installing exception handler.
author
Bas van Dijk
<v.dijk.bas@gmail.com>
Mon, 29 Mar 2010 13:16:24 +0000
(13:16 +0000)
committer
Bas van Dijk
<v.dijk.bas@gmail.com>
Mon, 29 Mar 2010 13:16:24 +0000
(13:16 +0000)
Note that I don't unblock the given io computation. Because AFAICS
withThread is only called with 'waitFd' which only performs an FFI
call which can't receive asynchronous exceptions anyway.
Control/Concurrent.hs
patch
|
blob
|
history
diff --git
a/Control/Concurrent.hs
b/Control/Concurrent.hs
index
ce668fb
..
a25e659
100644
(file)
--- 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