Ticket #3884 (closed bug: fixed)
killThread documentation
| Reported by: | Roel van Dijk | Owned by: | simonmar |
|---|---|---|---|
| Priority: | normal | Milestone: | 6.12.3 |
| Component: | Documentation | Version: | 6.12.1 |
| Keywords: | killThread throwTo | Cc: | vandijk.roel@… |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
The documentation for killThread states that:
killThread terminates the given thread (GHC only).
However, this is not unconditionally true. It is possible to create a thread that is unkillable. The following fails to terminate:
module Main where
import Control.Concurrent ( forkIO, killThread )
import Control.Exception ( block )
main :: IO ()
main = do tid <- block $ forkIO $ let x = x in x
killThread tid
This is not unexpected, but could be made a bit clearer in the documentation. Perhaps something like: "killThread attempts to terminate the given thread (GHC only)".
Change History
Note: See
TracTickets for help on using
tickets.
