From 5987f577cbf4cc8d9686c74c3be212f4eee618dc Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Thu, 28 May 2009 12:37:38 +0000 Subject: [PATCH] Fix #3257: document that exitWith in a forkIO'd thread does not exit the process --- System/Exit.hs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/System/Exit.hs b/System/Exit.hs index f4fbac5..1e74c1a 100644 --- a/System/Exit.hs +++ b/System/Exit.hs @@ -57,7 +57,12 @@ import System -- be caught using the functions of "Control.Exception". This means -- that cleanup computations added with 'Control.Exception.bracket' -- (from "Control.Exception") are also executed properly on 'exitWith'. - +-- +-- Note: in GHC, 'exitWith' should be called from the main program +-- thread in order to exit the process. When called from another +-- thread, 'exitWith' will throw an 'ExitException' as normal, but the +-- exception will not cause the process itself to exit. +-- #ifndef __NHC__ exitWith :: ExitCode -> IO a exitWith ExitSuccess = throwIO ExitSuccess -- 1.7.10.4