diff options
author | Simon Marlow <simonmar@microsoft.com> | 2006-05-03 11:11:52 +0000 |
---|---|---|
committer | Simon Marlow <simonmar@microsoft.com> | 2006-05-03 11:11:52 +0000 |
commit | 03aaf4d062af3875582498e4c58c0c298470ba8e (patch) | |
tree | 4d6da9044bed5492641052768f6154eb430403d3 /libraries | |
parent | a9c2fe4a3770ef5fcecb08eda02e503e2fee7582 (diff) | |
download | haskell-03aaf4d062af3875582498e4c58c0c298470ba8e.tar.gz |
inline withMVar, modifyMVar, modifyMVar_
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/base/Control/Concurrent/MVar.hs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libraries/base/Control/Concurrent/MVar.hs b/libraries/base/Control/Concurrent/MVar.hs index ea037baea3..7213cf14c5 100644 --- a/libraries/base/Control/Concurrent/MVar.hs +++ b/libraries/base/Control/Concurrent/MVar.hs @@ -73,6 +73,9 @@ swapMVar mvar new = original contents of the 'MVar' if an exception is raised (see "Control.Exception"). -} +{-# INLINE withMVar #-} +-- inlining has been reported to have dramatic effects; see +-- http://www.haskell.org//pipermail/haskell/2006-May/017907.html withMVar :: MVar a -> (a -> IO b) -> IO b withMVar m io = block $ do @@ -87,6 +90,7 @@ withMVar m io = 'modifyMVar' will replace the original contents of the 'MVar' if an exception is raised during the operation. -} +{-# INLINE modifyMVar_ #-} modifyMVar_ :: MVar a -> (a -> IO a) -> IO () modifyMVar_ m io = block $ do @@ -99,6 +103,7 @@ modifyMVar_ m io = A slight variation on 'modifyMVar_' that allows a value to be returned (@b@) in addition to the modified value of the 'MVar'. -} +{-# INLINE modifyMVar #-} modifyMVar :: MVar a -> (a -> IO (a,b)) -> IO b modifyMVar m io = block $ do |