From 00de4ab6cf86f437091fe5d8038bd5382dca364b Mon Sep 17 00:00:00 2001 From: sof Date: Fri, 21 Jan 2005 19:59:01 +0000 Subject: [PATCH] [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. --- GHC/Conc.lhs | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) 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 -- 1.7.10.4