Skip to content

Commit

Permalink
Clarification what 'atomic' means here.
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Z. Yang <ezyang@mit.edu>
  • Loading branch information
ezyang committed Jun 14, 2013
1 parent 07f8524 commit 16f71d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Control/Concurrent/MVar.hs
Expand Up @@ -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 =
Expand Down

0 comments on commit 16f71d6

Please sign in to comment.