diff options
author | Edward Z. Yang <ezyang@mit.edu> | 2013-07-12 18:12:44 -0700 |
---|---|---|
committer | Edward Z. Yang <ezyang@mit.edu> | 2013-07-12 18:12:44 -0700 |
commit | 9299fdf50beb2b1b6804ac8893f0f7241e93f294 (patch) | |
tree | 10f78f14dd696ff3ce3a5fb942e8ebae5a7ac6df /libraries/base/Control/Concurrent | |
parent | 0bb58e24f79226146bce85aa90c81dcf7108d241 (diff) | |
download | haskell-9299fdf50beb2b1b6804ac8893f0f7241e93f294.tar.gz |
Rename atomicReadMVar and friends to readMVar, replacing old readMVar.
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
Diffstat (limited to 'libraries/base/Control/Concurrent')
-rw-r--r-- | libraries/base/Control/Concurrent/MVar.hs | 21 |
1 files changed, 3 insertions, 18 deletions
diff --git a/libraries/base/Control/Concurrent/MVar.hs b/libraries/base/Control/Concurrent/MVar.hs index 0b3a0811b3..bfe72a85d6 100644 --- a/libraries/base/Control/Concurrent/MVar.hs +++ b/libraries/base/Control/Concurrent/MVar.hs @@ -142,8 +142,7 @@ module Control.Concurrent.MVar , modifyMVarMasked_ , modifyMVarMasked #ifndef __HUGS__ - , atomicReadMVar - , tryAtomicReadMVar + , tryReadMVar , mkWeakMVar , addMVarFinalizer #endif @@ -157,8 +156,8 @@ import Hugs.ConcBase ( MVar, newEmptyMVar, newMVar, takeMVar, putMVar, #ifdef __GLASGOW_HASKELL__ import GHC.MVar ( MVar(..), newEmptyMVar, newMVar, takeMVar, putMVar, - tryTakeMVar, tryPutMVar, isEmptyMVar, atomicReadMVar, - tryAtomicReadMVar + tryTakeMVar, tryPutMVar, isEmptyMVar, readMVar, + tryReadMVar ) import qualified GHC.MVar import GHC.Weak @@ -173,20 +172,6 @@ import Prelude import Control.Exception.Base {-| - This is a combination of 'takeMVar' and 'putMVar'; ie. it takes the value - from the 'MVar', puts it back, and also returns it. This function - is atomic only if there are no other producers (i.e. threads calling - 'putMVar') for this 'MVar'. Note: a 'tryTakeMVar' may temporarily - see the 'MVar' as empty while a read is occurring. --} -readMVar :: MVar a -> IO a -readMVar m = - mask_ $ do - a <- takeMVar m - putMVar m a - return a - -{-| Take a value from an 'MVar', put a new value into the 'MVar' and return the value taken. This function is atomic only if there are no other producers for this 'MVar'. |