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:
58aeab0
)
runInUnboundThread: block asynchronous exceptions before installing exception handler
author
Bas van Dijk
<v.dijk.bas@gmail.com>
Mon, 29 Mar 2010 13:15:49 +0000
(13:15 +0000)
committer
Bas van Dijk
<v.dijk.bas@gmail.com>
Mon, 29 Mar 2010 13:15:49 +0000
(13:15 +0000)
Control/Concurrent.hs
patch
|
blob
|
history
diff --git
a/Control/Concurrent.hs
b/Control/Concurrent.hs
index
75ee52e
..
ce668fb
100644
(file)
--- a/
Control/Concurrent.hs
+++ b/
Control/Concurrent.hs
@@
-430,7
+430,10
@@
runInUnboundThread action = do
if bound
then do
mv <- newEmptyMVar
- _ <- forkIO (Exception.try action >>= putMVar mv)
+ b <- blocked
+ _ <- block $ forkIO $
+ Exception.try (if b then action else unblock action) >>=
+ putMVar mv
takeMVar mv >>= \ei -> case ei of
Left exception -> Exception.throw (exception :: SomeException)
Right result -> return result