#4888: Document behaviour of throwTo to your own ThreadId
---------------------------------+------------------------------------------
Reporter: batterseapower | Owner:
Type: bug | Status: new
Priority: normal | Component: Documentation
Version: 7.0.1 | Keywords:
Testcase: | Blockedby:
Os: Unknown/Multiple | Blocking:
Architecture: Unknown/Multiple | Failure: Documentation bug
---------------------------------+------------------------------------------
The behaviour of `throwTo my_tid` could be considered surprising because
it seems to work exactly like `throw`.
Take these two tests:
{{{
main = do
tid <- myThreadId
putStrLn "Self-throw:"
throwTo tid (ErrorCall "Hello")
putStrLn "Masked self-throw:"
uninterruptibleMask_ $ throwTo tid (ErrorCall "Hello")
}}}
Both of them raise the exception immediately and thus terminate the
program. However, given the docs for throwTo and uninterruptibleMask an
equally valid interpretation would be for the second test to block
forever. Clarifying this might be useful.
(If you try either example in GHCi then no exception is thrown - is that a
bug?)
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/4888>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs