From: Simon Marlow Date: Thu, 28 May 2009 12:37:38 +0000 (+0000) Subject: Fix #3257: document that exitWith in a forkIO'd thread does not exit the process X-Git-Tag: 2009-06-25~29 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=5987f577cbf4cc8d9686c74c3be212f4eee618dc;p=ghc-base.git Fix #3257: document that exitWith in a forkIO'd thread does not exit the process --- 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