Skip to content

killThread documentation

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)".

Trac metadata
Trac field Value
Version 6.12.1
Type Bug
TypeOfFailure OtherFailure
Priority normal
Resolution Unresolved
Component Documentation
Test case
Differential revisions
BlockedBy
Related
Blocking
CC
Operating system
Architecture
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information