From: sof Date: Fri, 21 Jan 2005 19:59:01 +0000 (+0000) Subject: [project @ 2005-01-21 19:59:01 by sof] X-Git-Tag: nhc98-1-18-release~86 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=00de4ab6cf86f437091fe5d8038bd5382dca364b;p=ghc-base.git [project @ 2005-01-21 19:59:01 by sof] win32 only: Tidy up delivery and handling of console events by having the low-level console event handler signal the RTS thread blocked waiting for I/O. --- diff --git a/GHC/Conc.lhs b/GHC/Conc.lhs index edb9679..7c65383 100644 --- a/GHC/Conc.lhs +++ b/GHC/Conc.lhs @@ -395,18 +395,13 @@ addMVarFinalizer (MVar m) finalizer = -- in which they're used doesn't cause problems on a Win32 platform though.) asyncRead :: Int -> Int -> Int -> Ptr a -> IO (Int, Int) -asyncRead (I# fd) (I# isSock) (I# len) (Ptr buf) = do - (l, rc) <- IO (\s -> case asyncRead# fd isSock len buf s of - (# s, len#, err# #) -> (# s, (I# len#, I# err#) #)) - -- special handling for Ctrl+C-aborted 'standard input' reads; - -- see rts/win32/ConsoleHandler.c for details. - if (l == 0 && rc == -2) - then asyncRead (I# fd) (I# isSock) (I# len) (Ptr buf) - else return (l,rc) +asyncRead (I# fd) (I# isSock) (I# len) (Ptr buf) = + IO $ \s -> case asyncRead# fd isSock len buf s of + (# s, len#, err# #) -> (# s, (I# len#, I# err#) #) asyncWrite :: Int -> Int -> Int -> Ptr a -> IO (Int, Int) -asyncWrite (I# fd) (I# isSock) (I# len) (Ptr buf) = - IO $ \s -> case asyncWrite# fd isSock len buf s of +asyncWrite (I# fd) (I# isSock) (I# len) (Ptr buf) = + IO $ \s -> case asyncWrite# fd isSock len buf s of (# s, len#, err# #) -> (# s, (I# len#, I# err#) #) asyncDoProc :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int