From: sof Date: Wed, 16 Jul 2003 17:46:52 +0000 (+0000) Subject: [project @ 2003-07-16 17:46:52 by sof] X-Git-Tag: nhc98-1-18-release~589 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=32db97748d339d778f56886be07c0e38a8bdbd9a;p=ghc-base.git [project @ 2003-07-16 17:46:52 by sof] [win32]asyncDoProc :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int --- diff --git a/GHC/Conc.lhs b/GHC/Conc.lhs index cfb370c..279681b 100644 --- a/GHC/Conc.lhs +++ b/GHC/Conc.lhs @@ -47,7 +47,7 @@ module GHC.Conc #ifdef mingw32_TARGET_OS , asyncRead -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int) , asyncWrite -- :: Int -> Int -> Int -> Ptr a -> IO (Int, Int) - , asyncDoProc -- :: FunPtr (Ptr a -> IO ()) -> Ptr a -> IO () + , asyncDoProc -- :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int , asyncReadBA -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int) , asyncWriteBA -- :: Int -> Int -> Int -> Int -> MutableByteArray# RealWorld -> IO (Int, Int) @@ -332,12 +332,12 @@ 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 ()) -> Ptr a -> IO () +asyncDoProc :: FunPtr (Ptr a -> IO Int) -> Ptr a -> IO Int asyncDoProc (FunPtr proc) (Ptr param) = - -- the return values are ignored; simplifies implementation of + -- the 'length' value is ignored; simplifies implementation of -- the async*# primops to have them all return the same result. IO $ \s -> case asyncDoProc# proc param s of - (# s, len#, err# #) -> (# s, () #) + (# s, len#, err# #) -> (# s, I# err# #) -- to aid the use of these primops by the IO Handle implementation, -- provide the following convenience funs: