[commit: base] master: Clarification what 'atomic' means here. (16f71d6)

Edward Z. Yang ezyang at MIT.EDU
Fri Jun 14 19:58:43 CEST 2013


Repository : ssh://darcs.haskell.org//srv/darcs/packages/base

On branch  : master

https://github.com/ghc/packages-base/commit/16f71d65217017285707e773a6ffb82d2267af8b

>---------------------------------------------------------------

commit 16f71d65217017285707e773a6ffb82d2267af8b
Author: Edward Z. Yang <ezyang at mit.edu>
Date:   Fri Jun 14 10:58:40 2013 -0700

    Clarification what 'atomic' means here.
    
    Signed-off-by: Edward Z. Yang <ezyang at mit.edu>

>---------------------------------------------------------------

 Control/Concurrent/MVar.hs |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/Control/Concurrent/MVar.hs b/Control/Concurrent/MVar.hs
index f941be9..016192d 100644
--- a/Control/Concurrent/MVar.hs
+++ b/Control/Concurrent/MVar.hs
@@ -171,7 +171,8 @@ 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'.
+  '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 =





More information about the ghc-commits mailing list