From: simonmar Date: Thu, 14 Sep 2000 14:24:03 +0000 (+0000) Subject: [project @ 2000-09-14 14:24:02 by simonmar] X-Git-Tag: Approximately_9120_patches~3745 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=46b762e66f7874448b63275d5461eef43948c5ab;p=ghc-hetmet.git [project @ 2000-09-14 14:24:02 by simonmar] rename blockAsyncExceptions and unblockAsyncExceptions to block and unblock repectively, to match all the literature. DEPRECATE the old names. --- diff --git a/ghc/lib/std/PrelException.lhs b/ghc/lib/std/PrelException.lhs index 29f7edb..21d6b0b 100644 --- a/ghc/lib/std/PrelException.lhs +++ b/ghc/lib/std/PrelException.lhs @@ -1,5 +1,5 @@ % ------------------------------------------------------------------------------ -% $Id: PrelException.lhs,v 1.23 2000/07/09 16:00:55 panne Exp $ +% $Id: PrelException.lhs,v 1.24 2000/09/14 14:24:02 simonmar Exp $ % % (c) The University of Glasgow, 1998-2000 % @@ -105,18 +105,18 @@ bracket_ before after m = do \begin{code} #ifndef __HUGS__ -blockAsyncExceptions :: IO a -> IO a -blockAsyncExceptions (IO io) = IO $ blockAsyncExceptions# io +block :: IO a -> IO a +block (IO io) = IO $ blockAsyncExceptions# io -unblockAsyncExceptions :: IO a -> IO a -unblockAsyncExceptions (IO io) = IO $ unblockAsyncExceptions# io +unblock :: IO a -> IO a +unblock (IO io) = IO $ unblockAsyncExceptions# io #else -- Not implemented yet in Hugs. -blockAsyncExceptions :: IO a -> IO a -blockAsyncExceptions (IO io) = IO io +block :: IO a -> IO a +block (IO io) = IO io -unblockAsyncExceptions :: IO a -> IO a -unblockAsyncExceptions (IO io) = IO io +unblock :: IO a -> IO a +unblock (IO io) = IO io #endif \end{code} diff --git a/ghc/lib/std/PrelHandle.lhs b/ghc/lib/std/PrelHandle.lhs index 63e8f7e..a548426 100644 --- a/ghc/lib/std/PrelHandle.lhs +++ b/ghc/lib/std/PrelHandle.lhs @@ -1,5 +1,5 @@ % ------------------------------------------------------------------------------ -% $Id: PrelHandle.lhs,v 1.61 2000/08/29 16:37:35 simonpj Exp $ +% $Id: PrelHandle.lhs,v 1.62 2000/09/14 14:24:02 simonmar Exp $ % % (c) The AQUA Project, Glasgow University, 1994-2000 % @@ -116,7 +116,7 @@ but we might want to revisit this in the future --SDM ]. withHandle :: Handle -> (Handle__ -> IO (Handle__,a)) -> IO a {-# INLINE withHandle #-} withHandle (Handle h) act = - blockAsyncExceptions $ do + block $ do h_ <- takeMVar h (h',v) <- catchException (act h_) (\ ex -> putMVar h h_ >> throw ex) putMVar h h' @@ -125,7 +125,7 @@ withHandle (Handle h) act = withHandle_ :: Handle -> (Handle__ -> IO a) -> IO a {-# INLINE withHandle_ #-} withHandle_ (Handle h) act = - blockAsyncExceptions $ do + block $ do h_ <- takeMVar h v <- catchException (act h_) (\ ex -> putMVar h h_ >> throw ex) putMVar h h_ @@ -134,7 +134,7 @@ withHandle_ (Handle h) act = withHandle__ :: Handle -> (Handle__ -> IO Handle__) -> IO () {-# INLINE withHandle__ #-} withHandle__ (Handle h) act = - blockAsyncExceptions $ do + block $ do h_ <- takeMVar h h' <- catchException (act h_) (\ ex -> putMVar h h_ >> throw ex) putMVar h h'