Wed Jul  9 02:44:37 PDT 2008  Simon Marlow <[EMAIL PROTECTED]>
  * FIX part of #2301
    
  Control-C now causes the new exception (AsyncException UserInterrupt)
  to be raised in the main thread.  The signal handler is set up by
  GHC.TopHandler.runMainIO, and can be overriden in the usual way by
  installing a new signal handler.  The advantage is that now all
  programs will get a chance to clean up on ^C.
  
  When UserInterrupt is caught by the topmost handler, we now exit the
  program via kill(getpid(),SIGINT), which tells the parent process that
  we exited as a result of ^C, so the parent can take appropriate action
  (it might want to exit too, for example).
  
  One subtlety is that we have to use a weak reference to the ThreadId
  for the main thread, so that the signal handler doesn't prevent the
  main thread from being subject to deadlock detection.

    M ./GHC/IOBase.lhs +4
    M ./GHC/TopHandler.lhs -3 +77

View patch online:
http://darcs.haskell.org/packages/base/_darcs/patches/20080709094437-12142-5708b0adbc00e9dc38accad386f8b65da94c1ad0.gz
_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to