[project @ 2005-04-22 17:00:48 by sof]
authorsof <unknown>
Fri, 22 Apr 2005 17:00:49 +0000 (17:00 +0000)
committersof <unknown>
Fri, 22 Apr 2005 17:00:49 +0000 (17:00 +0000)
commitecb1a539308e65d242d963f00adc8c6c41e4972a
tree62439e4be600b5d1b80973c97e8eb6255149e268
parent68c138564102b83292df3e44287e0ec6ef598e51
[project @ 2005-04-22 17:00:48 by sof]
[mingw only]
Better handling of I/O request abortions upon throwing an exception
to a Haskell thread. As was, a thread blocked on an I/O request was
simply unblocked, but its corresponding worker thread wasn't notified
that the request had been abandoned.

This manifested itself in GHCi upon Ctrl-C being hit at the prompt -- the
worker thread blocked waiting for input on stdin prior to Ctrl-C would
stick around even though its corresponding Haskell thread had been
thrown an Interrupted exception. The upshot was that the worker would
consume the next character typed in after Ctrl-C, but then just dropping
it. Dealing with this turned out to be even more interesting due to
Win32 aborting any console reads when Ctrl-C/Break events are delivered.

The story could be improved upon (at the cost of portability) by making
the Scheduler able to abort worker thread system calls; as is, requests
are cooperatively abandoned. Maybe later.

Also included are other minor tidyups to Ctrl-C handling under mingw.

Merge to STABLE.
ghc/compiler/ghci/InteractiveUI.hs
ghc/includes/RtsExternal.h
ghc/includes/TSO.h
ghc/rts/Linker.c
ghc/rts/Schedule.c
ghc/rts/win32/AsyncIO.c
ghc/rts/win32/ConsoleHandler.c
ghc/rts/win32/ConsoleHandler.h
ghc/rts/win32/IOManager.c
ghc/rts/win32/IOManager.h