projects
/
ghc-base.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dc9be80
)
Correct the swapMVar haddock doc
author
Ian Lynagh
<igloo@earth.li>
Tue, 14 Aug 2007 14:50:28 +0000
(14:50 +0000)
committer
Ian Lynagh
<igloo@earth.li>
Tue, 14 Aug 2007 14:50:28 +0000
(14:50 +0000)
Control/Concurrent/MVar.hs
patch
|
blob
|
history
diff --git
a/Control/Concurrent/MVar.hs
b/Control/Concurrent/MVar.hs
index
fc3a30a
..
a5dc267
100644
(file)
--- a/
Control/Concurrent/MVar.hs
+++ b/
Control/Concurrent/MVar.hs
@@
-59,7
+59,12
@@
readMVar m =
putMVar m a
return a
--- |Atomically, put a new value into an 'MVar' and return the old value.
+{-|
+ Take a value from an 'MVar', put a new value into the 'MVar' and
+ return the value taken. Note that there is a race condition whereby
+ another process can put something in the 'MVar' after the take
+ happens but before the put does.
+-}
swapMVar :: MVar a -> a -> IO a
swapMVar mvar new =
block $ do