Ticket #3884 (closed bug: fixed)

Opened 3 years ago

Last modified 3 years ago

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

Changed 3 years ago by Roel van Dijk

  • cc vandijk.roel@… added

Changed 3 years ago by igloo

  • type changed from proposal to bug

Changed 3 years ago by simonmar

  • owner set to simonmar
  • milestone set to 6.12.3

Changed 3 years ago by simonmar

  • status changed from new to merge

Fixed:

Wed May  5 14:56:00 BST 2010  Simon Marlow <marlowsd@gmail.com>
  * improve the documentation for throwTo and killThread (#3884)

Changed 3 years ago by igloo

  • status changed from merge to closed
  • resolution set to fixed

Merged

Note: See TracTickets for help on using tickets.